From 451e1e7eaee282c9650c04e2813a8eeec34a6f4e Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 7 May 2024 18:08:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=88=E6=89=93=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=9C=8B=E7=9C=8B=E5=95=A5=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/em/services.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/em/services.py b/apps/em/services.py index 4e5b0cd7..34d58774 100644 --- a/apps/em/services.py +++ b/apps/em/services.py @@ -18,6 +18,8 @@ def get_eq_rs(equipId: str): def set_eq_rs(equipId, last_timex: datetime, last_mrs: int): """更新设备运行状态(包括缓存和数据库) """ + if equipId == '3574620497738379264' and last_mrs == Equipment.RUNING: + myLogger.error(f'{equipId} {last_timex} {last_mrs}') if last_mrs == Equipment.OFFLINE: # 如果是离线直接更新 cache.set(f"equipment_{equipId}", {"running_state": last_mrs, "running_state_timex": last_timex}, timeout=None) # 更新缓存 Equipment.objects.filter(id=equipId).update(running_state=last_mrs) # 更新数据库