This commit is contained in:
PawelDopierala 2024-11-26 21:07:28 +01:00
parent 36888fcd48
commit 5fcef73d3d

View File

@ -19,7 +19,7 @@ def run_compute(a,b,sigma):
capture_output=True,
text=True
)
return result.stdout.strip()
return int(result.stdout.strip().strip('"'))
@app.post("/compute")
async def compute(data: ComputeInput):
@ -37,7 +37,7 @@ async def compute(data: ComputeInput):
futures = [executor.submit(run_compute, a, b, sigma) for a, b in ranges]
results = [f.result() for f in futures]
return results
return sum(results)
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)