优化高德key生成

This commit is contained in:
Jian Shen
2022-07-18 16:17:58 +08:00
parent 90bdfe2404
commit bbc760e64b
+14 -4
View File
@@ -1,11 +1,21 @@
from goojia_utils import REDIS_CLIENT
"""
高德key每日定时生成
"""
amap_key = {"4e9592208336433ee1b7aa4d1d434418": 280000,
"10bcb421d2ee4e51ed9268d6dca58ad1": 280000}
amap_key = {"4e9592208336433ee1b7aa4d1d434418", "10bcb421d2ee4e51ed9268d6dca58ad1"}
for key in amap_key.keys():
REDIS_CLIENT.hset("amapKey", key, amap_key[key])
service = {'v3/geocode/geo': 2900000,
'v3/geocode/regeo': 2900000,
'v3/place/text': 290000,
'v5/place/text': 290000,
'v3/place/around': 290000,
'v5/place/around': 290000,
'v3/place/detail': 290000,
'v5/place/detail': 290000}
for key in amap_key:
for service_key in service.keys():
REDIS_CLIENT.hset("amapKey", key + "@" + service_key, service[service_key])