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