This commit is contained in:
DingZQ
2023-10-20 23:33:12 +08:00
parent 48cdf8f0dd
commit 8ac8822563

11
main.py
View File

@@ -148,17 +148,12 @@ isSimulaion = False
# 必须用这个PlainTextResponse不然每个key都有引号
@app.get("/runproject/", response_class = PlainTextResponse)
async def fastapi_run_project(network: str) -> str:
for i in range(10000):
if isSimulaion == False:
break
time.sleep(5)
result = {}
if isSimulaion == False:
result = run_project(network)
isSimulaion = False
return result
return result
else:
return "正在进行其他计算任务"
# put in inp folder, name without extension
@app.get("/runinp/")