Quellcode durchsuchen

fix: 重复通知频率改为每天最多一次,并且只在 10-17点发送

wuwenyi vor 1 Woche
Ursprung
Commit
c4947e0d07

+ 5 - 2
src/main/java/com/qqflow/engine/domain/flow/job/OverdueCheckJob.java

@@ -55,6 +55,9 @@ public class OverdueCheckJob {
     }
 
     private void doCheck() {
+        int hour = LocalDateTime.now().getHour();
+        if (hour < 10 || hour >= 17) return;
+
         LocalDateTime now = LocalDateTime.now();
         LocalDateTime warningThreshold = now.plusHours(24);
 
@@ -96,8 +99,8 @@ public class OverdueCheckJob {
             String nodeName = task.getNodeName();
             this.notificationService.notifyTaskOverdue(
                     task, processName, title, nodeName, overdue);
-            // 超时通知标记保留 1 小时,预警保留 24 小时,期间不再重复发送
-            redissonService.set(flagKey, "1", overdue ? 1 : 24, TimeUnit.HOURS);
+            // 每天最多通知一次
+            redissonService.set(flagKey, "1", 24, TimeUnit.HOURS);
         } catch (Exception e) {
             log.error("[超时检查] 发送催办通知失败,taskId={}", task.getId(), e);
         }