Преглед изворни кода

优化测试服存表逻辑

peng пре 1 година
родитељ
комит
60ce921c3c
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      Service/DevicePushService.py

+ 3 - 1
Service/DevicePushService.py

@@ -18,7 +18,7 @@ import requests
 
 from AnsjerPush.Config.aiConfig import DEVICE_EVENT_TYPE, ALGORITHM_COMBO_TYPES
 from AnsjerPush.config import CONFIG_INFO, CONFIG_CN, MULTI_CHANNEL_TYPE_LIST, SYS_EVENT_TYPE_LIST, AWS_ACCESS_KEY_ID, \
-    AWS_SECRET_ACCESS_KEY, EVENT_DICT, EVENT_DICT_CN, CONFIG_US
+    AWS_SECRET_ACCESS_KEY, EVENT_DICT, EVENT_DICT_CN, CONFIG_US, CONFIG_TEST
 from AnsjerPush.config import XMPUSH_CONFIG, OPPOPUSH_CONFIG, XM_PUSH_CHANNEL_ID
 from Model.models import UidPushModel, SysMsgModel, DeviceSharePermission, DeviceChannelUserSet, \
     DeviceChannelUserPermission, UidSetModel, Device_Info
@@ -253,6 +253,8 @@ class DevicePushService:
                     # 缓存数据多于100条,批量保存前100条,否则保存全部
                     equipment_info_len = redis_obj.llen(equipment_info_key)
                     end = 99 if equipment_info_len > 100 else equipment_info_len - 1
+                    if CONFIG_INFO == CONFIG_TEST:
+                        end = equipment_info_len
 
                     if end != 0:
                         equipment_info_redis_list = redis_obj.lrange(equipment_info_key, 0, end)