Browse Source

同一推送任务分多的定时任务执行

Signed-off-by: Binren Zhnag <zhangbr@elab-plus.com>
Binren Zhnag 4 years ago
parent
commit
cbde8b2346
2 changed files with 85 additions and 1 deletions
  1. 84 0
      apscheduler_elab.py
  2. 1 1
      jianye_report.py

+ 84 - 0
apscheduler_elab.py

@@ -67,6 +67,60 @@ class Config(object):
             'day_of_week': '*',
             'hour': 6,
             'minute': 45
+        },
+        {
+            'id': 'day_work_6',
+            'func': 'apscheduler_elab:Funcs.day_work_6',
+            'args': '',
+            'trigger': 'cron',
+            'day_of_week': '*',
+            'hour': 6,
+            'minute': 45
+        },
+        {
+            'id': 'day_work_7',
+            'func': 'apscheduler_elab:Funcs.day_work_7',
+            'args': '',
+            'trigger': 'cron',
+            'day_of_week': '*',
+            'hour': 6,
+            'minute': 45
+        },
+        {
+            'id': 'day_work_8',
+            'func': 'apscheduler_elab:Funcs.day_work_8',
+            'args': '',
+            'trigger': 'cron',
+            'day_of_week': '*',
+            'hour': 6,
+            'minute': 45
+        },
+        {
+            'id': 'day_work_9',
+            'func': 'apscheduler_elab:Funcs.day_work_9',
+            'args': '',
+            'trigger': 'cron',
+            'day_of_week': '*',
+            'hour': 6,
+            'minute': 45
+        },
+        {
+            'id': 'day_work_10',
+            'func': 'apscheduler_elab:Funcs.day_work_10',
+            'args': '',
+            'trigger': 'cron',
+            'day_of_week': '*',
+            'hour': 6,
+            'minute': 45
+        },
+        {
+            'id': 'day_work_11',
+            'func': 'apscheduler_elab:Funcs.day_work_11',
+            'args': '',
+            'trigger': 'cron',
+            'day_of_week': '*',
+            'hour': 6,
+            'minute': 45
         }
     ]
 
@@ -117,6 +171,36 @@ class Funcs(object):
         jianye = JianYeReport()
         jianye.send_mail_to_customer(5)
 
+    @staticmethod
+    def day_work_6():
+        jianye = JianYeReport()
+        jianye.send_mail_to_customer(6)
+
+    @staticmethod
+    def day_work_7():
+        jianye = JianYeReport()
+        jianye.send_mail_to_customer(7)
+
+    @staticmethod
+    def day_work_8():
+        jianye = JianYeReport()
+        jianye.send_mail_to_customer(8)
+
+    @staticmethod
+    def day_work_9():
+        jianye = JianYeReport()
+        jianye.send_mail_to_customer(9)
+
+    @staticmethod
+    def day_work_10():
+        jianye = JianYeReport()
+        jianye.send_mail_to_customer(10)
+
+    @staticmethod
+    def day_work_11():
+        jianye = JianYeReport()
+        jianye.send_mail_to_customer(11)
+
     @staticmethod
     def minute_push_elab():
         # pdu = PandaUtil('linshi')

+ 1 - 1
jianye_report.py

@@ -296,7 +296,7 @@ class JianYeReport(object):
                 except Exception as e:
                     print(str(e))
                     send_mail_log.append([mail[5], mail[2], mail[3], -1, str(e)])
-            self.db.add_some(send_mail_info, Sql.sql_12)
+            self.db.add_some(send_mail_log, Sql.sql_12)
             message[2] = '遇见发送完毕, 共:{}份邮件'.format(len(send_mail_info))
         except Exception as e:
             message['error'] = str(e)