From 5da8fb7c072cf84c52f92fbbf8b4bdc86a8cda60 Mon Sep 17 00:00:00 2001 From: DingZQ Date: Thu, 30 Jan 2025 23:12:10 +0800 Subject: [PATCH] Refine --- main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.py b/main.py index 1314856..7e8ebdb 100644 --- a/main.py +++ b/main.py @@ -180,6 +180,8 @@ async def fastapi_run_project(network: str) -> str: # 尝试获取锁(NX=True: 不存在时设置,EX=timeout: 过期时间) acquired = redis_client.set(lock_key, "locked", nx=True, ex=timeout) + logging.log(acquired) + if not acquired: raise HTTPException(status_code=409, detail="is in simulation") else: