From 962519811b7c4be07f30d09e791798b0ea79d3ae Mon Sep 17 00:00:00 2001
From: 黄千龙 <huangqianlong@prec-tech.com>
Date: 星期三, 08 三月 2023 09:54:02 +0800
Subject: [PATCH] 同步代码

---
 force-app/main/default/classes/LogAutoSendSchedule.cls |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/force-app/main/default/classes/LogAutoSendSchedule.cls b/force-app/main/default/classes/LogAutoSendSchedule.cls
index 9673029..567d608 100644
--- a/force-app/main/default/classes/LogAutoSendSchedule.cls
+++ b/force-app/main/default/classes/LogAutoSendSchedule.cls
@@ -62,9 +62,12 @@
         Datetime addOneM = System.now().addMinutes(2);
         String CRON_EXP = '0 ' + addOneM.minute() + ' ' + addOneM.hour() + ' ' + addOneM.day() + ' ' + addOneM.month() + ' ? ' + addOneM.year();
         List<CronTrigger> oldcron = [select Id from CronTrigger where CronExpression = :CRON_EXP and CronJobDetail.Name like 'LogAutoSend%'];
-        if (oldcron.size() == 0) {
-            System.schedule('LogAutoSend' + CRON_EXP, CRON_EXP, new LogAutoSendSchedule( messageGroupNumber, type));
-        }
+        // if (oldcron.size() == 0) {
+            Datetime nowTime = Datetime.now();
+            // System.schedule(+'LogAutoSend'+ CRON_EXP, CRON_EXP, new LogAutoSendSchedule( messageGroupNumber, type));
+            System.schedule(+'LogAutoSend'+nowTime+'And'+messageGroupNumber + CRON_EXP, CRON_EXP, new LogAutoSendSchedule( messageGroupNumber, type));
+        
+        // }
         for (CronTrigger ct :
                 [SELECT Id FROM CronTrigger WHERE State = 'DELETED' and CronJobDetail.Name like 'LogAutoSend%']) {
             System.abortJob(ct.id);

--
Gitblit v1.9.1