Browse Source

优化设备激活时间

zhangdongming 2 months ago
parent
commit
bcd86de37e
1 changed files with 2 additions and 1 deletions
  1. 2 1
      AdminController/CloudServiceManage/AgentDeviceController.py

+ 2 - 1
AdminController/CloudServiceManage/AgentDeviceController.py

@@ -361,10 +361,11 @@ class AgentDeviceView(View):
             device_info = AgentDevice.objects.filter(serial_number=serial_number)
             if not device_info.exists():
                 return
+            LOGGER.info('同步更新设备激活状态serial:{},type:{}'.format(serial_number, bind_type))
             n_time = int(time.time())
             if bind_type == 1:
                 # 绑定设备
-                device_info.update(status=1, updated_time=n_time)
+                device_info.update(status=1, updated_time=n_time, at_time=n_time)
             elif bind_type == 2:
                 # 解绑设备
                 device_info.update(status=0, updated_time=n_time)