|
@@ -32,12 +32,13 @@ end_date_month = (datetime.datetime.now() + dateutil.relativedelta.relativedelta
|
|
|
# start_date_month = "20220903"
|
|
|
# end_date_month = "20230201"
|
|
|
def job():
|
|
|
- if datetime.date.today().day != 1:
|
|
|
+ if datetime.date.today().day != 2:
|
|
|
print("%s 等待4号执行程序"%datetime_now())
|
|
|
else:
|
|
|
# 连接mysql
|
|
|
MysqlUtil = MysqlUtils(**mysql)
|
|
|
|
|
|
+ days = get_day_1(start_date_month, end_date_month)
|
|
|
for date in days:
|
|
|
print("%s 开始导入%s的数据"%(datetime_now(),date))
|
|
|
MysqlUtil.update_two(REPLACE_EQUIP_SQL%(date),DELETE_EQUIP_SQL%(date))
|
|
@@ -48,8 +49,7 @@ def job():
|
|
|
MysqlUtil.close()
|
|
|
|
|
|
|
|
|
-schedule.every().day.at("08:30").do(job)
|
|
|
+schedule.every().day.at("20:30").do(job)
|
|
|
while True:
|
|
|
- days = get_day_1(start_date_month, end_date_month)
|
|
|
schedule.run_pending()
|
|
|
time.sleep(30)
|