新增高德key定时生成任务
This commit is contained in:
+2
-1
@@ -1,4 +1,5 @@
|
||||
poi/business/.*
|
||||
stat/evaluate/*
|
||||
stat/community/*
|
||||
mt/supply/*
|
||||
mt/supply/*
|
||||
business/business/*
|
||||
@@ -0,0 +1,16 @@
|
||||
from airflow.operators.bash import BashOperator
|
||||
import pendulum
|
||||
from airflow import DAG
|
||||
|
||||
with DAG(
|
||||
"amap_key_generate_dag",
|
||||
# 每天运行
|
||||
schedule_interval="0 2 * * *",
|
||||
start_date=pendulum.datetime(2022, 7, 18, tz="Asia/Shanghai"),
|
||||
catchup=True,
|
||||
) as dag:
|
||||
t1 = BashOperator(
|
||||
task_id='amap_key_generate',
|
||||
bash_command='python /opt/airflow/dags/repo/dags/business/business/amap_key_generate.py',
|
||||
)
|
||||
t1
|
||||
@@ -0,0 +1,11 @@
|
||||
from goojia_utils import REDIS_CLIENT
|
||||
|
||||
"""
|
||||
高德key每日定时生成
|
||||
"""
|
||||
amap_key = {"4e9592208336433ee1b7aa4d1d434418": 280000,
|
||||
"10bcb421d2ee4e51ed9268d6dca58ad1": 280000}
|
||||
|
||||
for key in amap_key.keys():
|
||||
REDIS_CLIENT.hset("amapKey", key, amap_key[key])
|
||||
|
||||
Reference in New Issue
Block a user