Skip to content

Commit

Permalink
fix: return correct result json (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmoesbergen authored Aug 26, 2023
1 parent 9be0c2b commit 4bc75ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async def _compile_sketch(sketch: Sketch) -> dict[str, str]:


@app.post("/compile/cpp")
async def compile_cpp(sketch: Sketch, session_id: Session):
async def compile_cpp(sketch: Sketch, session_id: Session) -> dict[str, str]:
# Make sure there's no more than X compile requests per user
sessions[session_id] += 1

Expand All @@ -83,7 +83,7 @@ async def compile_cpp(sketch: Sketch, session_id: Session):
# Nope -> compile and store in cache
await _install_libraries(sketch.libraries)
result = await _compile_sketch(sketch)
code_cache[cache_key] = result["hex"]
code_cache[cache_key] = result
return result
finally:
sessions[session_id] -= 1

0 comments on commit 4bc75ca

Please sign in to comment.