chanjunkai 5 年之前
父節點
當前提交
8e9eb969b4
共有 1 個文件被更改,包括 4 次插入11 次删除
  1. 4 11
      Controller/DetectController.py

+ 4 - 11
Controller/DetectController.py

@@ -124,16 +124,9 @@ class NotificationView(View):
             if have_dkey:
                 detect_med_type = 1
             detect_med_type = 2
-
-        # if detect_group:
-        #     detect_group_list = detect_group.split(',')
-        #     detect_med_type = 1
-        #     if not have_dkey:
-        #         # 限制时间内,1分钟外,存库,不推消息
-        #         detect_med_type = 2
-        #     if event_type in detect_group_list:
-        #         redisObj.set_data(key=dkey, val=1, expire=detect_interval)
-
+            detect_group_list = detect_group.split(',')
+            if event_type in detect_group_list:
+                redisObj.set_data(key=dkey, val=1, expire=detect_interval)
 
         auth = oss2.Auth(OSS_STS_ACCESS_KEY, OSS_STS_ACCESS_SECRET)
         bucket = oss2.Bucket(auth, 'oss-cn-shenzhen.aliyuncs.com', 'apg')
@@ -168,7 +161,7 @@ class NotificationView(View):
             kwag_args['msg_text'] = msg_text
             # 第一次进来,才推送
             print("第一次进来推送")
-            if detect_group == 2 or detect_group == 0:
+            if detect_med_type == 2 or detect_med_type == 0:
                 if push_type == 0:  # ios apns
                     self.do_apns(**kwag_args)
                 elif push_type == 1:  # android gcm