Browse Source

增加定时任务

Signed-off-by: binren <zhangbr@elab-plus.com>
binren 4 years ago
parent
commit
179c0c6a33
1 changed files with 15 additions and 0 deletions
  1. 15 0
      apscheduler_elab.py

+ 15 - 0
apscheduler_elab.py

@@ -10,6 +10,7 @@ class Config(object):
         day_push:1
         week_push_one:2
         week_push_two: 3
+        day_work_two: 4
     """
     JOBS = [
         {
@@ -38,6 +39,15 @@ class Config(object):
             'day_of_week': 'mon',
             'hour': 10,
             'minute': 50
+        },
+        {
+            'id': 'day_work_two',
+            'func': 'apscheduler_elab:Funcs.day_work_two',
+            'args': '',
+            'trigger': 'cron',
+            'day_of_week': '*',
+            'hour': 18,
+            'minute': 20
         }
     ]
 
@@ -72,6 +82,11 @@ class Funcs(object):
         rp = ReportPush('bi_report')
         rp.report_push(3)
 
+    @staticmethod
+    def day_work_two():
+        rp = ReportPush('bi_report')
+        rp.report_push(4)
+
     @staticmethod
     def minute_push_elab():
         # pdu = PandaUtil('linshi')