Browse Source

取消定时任务,由系统判断启动

Eric412V 3 years ago
parent
commit
fa98ff1a4f
2 changed files with 3 additions and 8 deletions
  1. 3 8
      LIB/MIDDLE/SaftyCenter/Low_Soc_Alarm/main.py
  2. BIN
      Low_Soc_Alarm.xlsx

+ 3 - 8
LIB/MIDDLE/SaftyCenter/Low_Soc_Alarm/main.py

@@ -73,18 +73,13 @@ def Low_Soc_Alarm():
         low_soc_bat_list=Low_soc_alarm.low_soc_alarm(param,df_bms,low_soc_bat_list,sn,df_OprtnSta)
 
 
-        return low_soc_bat_list
+    return low_soc_bat_list
 mylog=log.Mylog('log_diag.txt','error')
 mylog.logcfg()
-scheduler = BlockingScheduler()
-low_soc_bat_list=Low_Soc_Alarm()
-low_soc_bat_list.to_excel('Low_Soc_Alarm.xlsx')
-#------------------------------------定时执行程序-----------------------------------------------------------
-scheduler.add_job(Low_Soc_Alarm, 'interval',days=1, start_date='2021-11-12 00:00:00', id='low_soc_alarm')
+
 
 try:  
-    scheduler.start()
+    low_soc_bat_list=Low_Soc_Alarm()
 except Exception as e:
-    scheduler.shutdown()
     print(repr(e))
     mylog.logopt(e)

BIN
Low_Soc_Alarm.xlsx