Refine
This commit is contained in:
2
main.py
2
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:
|
||||
|
||||
Reference in New Issue
Block a user