Kaynağa Gözat

欧洲区存储位置根据缓存获取

zhangdongming 2 ay önce
ebeveyn
işleme
a3e377ac27

+ 8 - 1
Controller/DetectControllerV2.py

@@ -7,8 +7,8 @@ from django.views.generic.base import View
 
 from AnsjerPush.config import CONFIG_EUR, CONFIG_INFO, CONFIG_US, UNRESTRICTED_FREQUENCY_PUSH_EVENT_TYPE_LIST
 from Object.RedisObject import RedisObject
+from Object.enums.RedisKeyConstant import RedisKeyConstant
 from Service.DevicePushService import DevicePushService
-from Object.enums.EventTypeEnum import EventTypeEnumObj
 
 TIME_LOGGER = logging.getLogger('time')
 ERROR_INFO_LOGGER = logging.getLogger('error_info')
@@ -136,6 +136,13 @@ class NotificationV2View(View):
                 storage_location = 3
             elif CONFIG_INFO == CONFIG_EUR:
                 storage_location = 4
+                try:
+                    config_key = RedisKeyConstant.PUSH_STORAGE_CONFIG_UID.value + uid
+                    config_value = redis_obj.get_data(key=config_key)
+                    if config_value:  # 有配置则使用配置
+                        storage_location = int(config_value)
+                except Exception as e:
+                    TIME_LOGGER.error('获取缓存推送存储位置异常uid:{},error:{}'.format(uid, repr(e)))
             else:
                 if storage_location is not None:
                     storage_location = int(storage_location)

+ 6 - 0
Object/enums/RedisKeyConstant.py

@@ -0,0 +1,6 @@
+from enum import Enum
+
+
+class RedisKeyConstant(Enum):
+    # 设备版本信息
+    PUSH_STORAGE_CONFIG_UID = 'push:store:config:uid:'