From 601bb0ae600055e67404dd3d1674ff29adc0dbfe Mon Sep 17 00:00:00 2001 From: caoqianming Date: Sun, 28 Apr 2024 14:45:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20set=5Feq=5Frs=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=8A=B6=E6=80=81=E5=BF=98=E8=AE=B0=E4=BC=A0?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/em/services.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/em/services.py b/apps/em/services.py index efd935e3..c8a7719d 100644 --- a/apps/em/services.py +++ b/apps/em/services.py @@ -18,7 +18,7 @@ def set_eq_rs(equipId, last_timex: datetime, last_mrs: int): 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) # 更新数据库 else: - eq_rs_cache = get_eq_rs() + eq_rs_cache = get_eq_rs(equipId) eq_rs_change = False if eq_rs_cache["running_state"] != last_mrs: # 如果状态变动了要调用方法否则只需更新缓存