优化定时

This commit is contained in:
沈健
2025-03-03 09:44:23 +08:00
parent 3a30ed8880
commit 5b5252c185
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ with DAG(
) as dag:
t1 = BashOperator(
task_id='base_price',
bash_command='python /opt/airflow/dags/repo/dags/office/rent/base_price.py',
bash_command='python /opt/airflow/dags/repo/dags/office/rent/base_price.py {{dag_run.conf["yearmonth"] if "yearmonth" in dag_run.conf}}',
)
t1
+4 -4
View File
@@ -16,6 +16,7 @@ from datetime import datetime
from pymongo import UpdateOne
import math
import numpy as np
import sys
es = ElasticSearchClient(host='192.168.0.206')
seaweed_df = MAIN_MONGO_CLIENT.get_collection('fangjia', 'seaweed')
@@ -304,7 +305,6 @@ def calc(city, year_month):
actions.clear()
office_rent_stat_conn.bulk_write(actions)
for year_month in range(202406, 202501):
print(year_month)
calc(None, year_month)
#calc('上海', 202412)
yearmonth = sys.argv[1] if len(sys.argv) > 1 else None
calc(None, yearmonth)