Refine
This commit is contained in:
4
main.py
4
main.py
@@ -155,11 +155,13 @@ async def fastapi_dump_inp(network: str, inp: str) -> bool:
|
|||||||
async def fastapi_run_project(network: str) -> str:
|
async def fastapi_run_project(network: str) -> str:
|
||||||
global lock_simulation
|
global lock_simulation
|
||||||
|
|
||||||
|
print('lock simulation')
|
||||||
|
print(lock_simulation.value)
|
||||||
|
|
||||||
if lock_simulation.value == 1:
|
if lock_simulation.value == 1:
|
||||||
raise HTTPException(status_code=409, detail="is in simulation")
|
raise HTTPException(status_code=409, detail="is in simulation")
|
||||||
|
|
||||||
with lock_simulation.get_lock():
|
with lock_simulation.get_lock():
|
||||||
print('lock simulation')
|
|
||||||
lock_simulation.value = 1
|
lock_simulation.value = 1
|
||||||
result = run_project(network)
|
result = run_project(network)
|
||||||
lock_simulation.value = 0
|
lock_simulation.value = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user