Explorar el Código

优化设备激活时间

zhangdongming hace 2 meses
padre
commit
bcd86de37e
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  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)