浏览代码

修改addOrUpdate5

tanghongbin 4 年之前
父节点
当前提交
407058df8e
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 3 3
      Controller/EquipmentManagerV3.py
  2. 1 1
      Service/ModelService.py

+ 3 - 3
Controller/EquipmentManagerV3.py

@@ -172,9 +172,9 @@ class EquipmentManagerV3(View):
                     UidSetModel.objects.create(**uid_set_create_dict)
                     UidSetModel.objects.create(**uid_set_create_dict)
                 di_qs = Device_Info.objects.filter(UID=uid)
                 di_qs = Device_Info.objects.filter(UID=uid)
                 di_qs.update(NickName=nickname)
                 di_qs.update(NickName=nickname)
-                if deviceData is not None and deviceData.__contains__('NickName') and us_qs[0].is_alexa:
-                    asy = threading.Thread(target=ModelService.notify_alexa_add, args=(uid, userID, nickname))
-                    asy.start()
+                # if deviceData is not None and deviceData.__contains__('NickName') and us_qs[0].is_alexa:
+                asy = threading.Thread(target=ModelService.notify_alexa_add, args=(uid, userID, nickname))
+                asy.start()
             # redisObj = RedisObject(db=8)
             # redisObj = RedisObject(db=8)
             # redisObj.del_data(key='uid_qs_' + userID)
             # redisObj.del_data(key='uid_qs_' + userID)
             return response.json(0, res)
             return response.json(0, res)

+ 1 - 1
Service/ModelService.py

@@ -164,7 +164,7 @@ class ModelService:
             'uid_nick': nickname
             'uid_nick': nickname
         }
         }
         try:
         try:
-            requests.post(url, data=data, timeout=5)
+            requests.post(url, data=data, timeout=10)
         except Exception as e:
         except Exception as e:
             print(repr(e))
             print(repr(e))