Skip to content

fix(api): return floor json directly and stop blocking the server - #121

Merged
Joltras merged 4 commits into
devfrom
fix/api-file-handling
Nov 2, 2026
Merged

Joltras merged 4 commits into
devfrom
fix/api-file-handling

Conversation

@Joltras

@Joltras Joltras commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Proposed changes

The API wrote every generated floor to a file in the working directory that was never cleaned up, so it now returns the JSON directly with the same body and headers as before. The CORS setup reflected any origin while allowing credentials, which the API does not need, so credentials are now disabled. Each generator now uses its own random number generator instead of the global one, which keeps all seeds producing identical floors and makes concurrent generation safe. With that in place, the generation endpoints are synchronous so FastAPI runs them in its thread pool instead of blocking the event loop.

Types of changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

@Joltras
Joltras merged commit c604780 into dev Nov 2, 2026
4 checks passed
@Joltras
Joltras deleted the fix/api-file-handling branch November 2, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant