chanjunkai 5 年之前
父节点
当前提交
bc0f814380
共有 1 个文件被更改,包括 10 次插入5 次删除
  1. 10 5
      Controller/DetectController.py

+ 10 - 5
Controller/DetectController.py

@@ -113,13 +113,18 @@ class NotificationView(View):
                 detect_med_type = 1
             else:
                 detect_med_type = 2
-                detect_group_list = detect_group.split(',')
-                if event_type in detect_group_list:
-                    if detect_interval < 60:
-                        detect_interval = 60
+                # detect_group=0允许全部推送的时候
+                if detect_group == '0':
                     redisObj.set_data(key=dkey, val=1, expire=detect_interval)
+                else:
+                    detect_group_list = detect_group.split(',')
+                    if event_type in detect_group_list:
+                        if detect_interval < 60:
+                            detect_interval = 60
+                        redisObj.set_data(key=dkey, val=1, expire=detect_interval)
                 redisObj.set_data(key=pkey, val=1, expire=60)
-        # 旧模式并且没有pkey,重新创建一个
+
+    # 旧模式并且没有pkey,重新创建一个
         if not detect_group and not have_pkey:
             # 设置推送时间为60秒一次
             redisObj.set_data(key=pkey, val=1, expire=60)