浏览代码

移除查询系统未读消息重复代码,欧洲获取移动侦测加长缓存时间

zhangdongming 11 月之前
父节点
当前提交
26e9b38509
共有 2 个文件被更改,包括 4 次插入2 次删除
  1. 0 1
      Controller/SysManage.py
  2. 4 1
      Service/EquipmentInfoService.py

+ 0 - 1
Controller/SysManage.py

@@ -110,7 +110,6 @@ def initMsgFunc(request):
     userID = tko.userID
     seven_days_ago = int(time.time()) - 3600 * 24 * 7  # 过滤七天前数据
     sm_count = SysMsgModel.objects.filter(userID_id=userID, status=0).count()
-    sm_count = SysMsgModel.objects.filter(userID_id=userID, status=0).count()
 
     kwargs = {
         'device_user_id': userID,

+ 4 - 1
Service/EquipmentInfoService.py

@@ -569,7 +569,10 @@ class EquipmentInfoService:
             count += equipment_info_model.objects.filter(**kwargs).count()
         if count == 0:
             return count
-        redis_obj.set_data(key, count, 60)
+        if CONFIG_EUR == CONFIG_INFO and count > 99:
+            redis_obj.set_data(key, count, 300)
+        else:
+            redis_obj.set_data(key, count, 60)
         return count
 
     @classmethod