Refine
This commit is contained in:
2
main.py
2
main.py
@@ -180,7 +180,7 @@ async def fastapi_run_project(network: str) -> str:
|
|||||||
# 尝试获取锁(NX=True: 不存在时设置,EX=timeout: 过期时间)
|
# 尝试获取锁(NX=True: 不存在时设置,EX=timeout: 过期时间)
|
||||||
acquired = redis_client.set(lock_key, "locked", nx=True, ex=timeout)
|
acquired = redis_client.set(lock_key, "locked", nx=True, ex=timeout)
|
||||||
|
|
||||||
logging.log(acquired)
|
logger.log(f"acquuire {acquired}")
|
||||||
|
|
||||||
if not acquired:
|
if not acquired:
|
||||||
raise HTTPException(status_code=409, detail="is in simulation")
|
raise HTTPException(status_code=409, detail="is in simulation")
|
||||||
|
|||||||
Reference in New Issue
Block a user