The deadline consumer runs in a long-lived task outside any request, so a timeout that ended the match raised 'No TortoiseContext is currently active' in save_match_result before the state was saved: the game stayed stuck on the last turn and the entry retried forever. It only surfaced on the match-deciding turn; ordinary timeouts and human plays were fine. Bind the Tortoise context before persisting a finished match (optional context_binder wired to TortoiseMixin.ensure_context), and back off to the heartbeat when a due entry fails instead of hot-looping on it.
tavolo-app
The deployable tavolo application: the composition root wiring
tavolo-platform to the
tavolo-scopone game.
Contents
app.py— assembles theKayaApp(session/OIDC/Tortoise/OpenAPI mixins plusPlatformMixinand the deadline scheduler), registers theScoponeEnginewith its configured timeouts, and exposestavolo.app:appfor granian.config.py— environment-driven frozenSettings.aerich_config.py— Tortoise ORM configuration consumed by the aerich CLI (migrations live inserver/migrations/; aerich itself is configured via the[tool.aerich]section ofserver/pyproject.toml).logging_config.py— logging setup.static.py— SPA shell hosting for the compiled frontend.
Development (from packages/tavolo-app/)
.venv/bin/python -m mypy --namespace-packages --explicit-package-bases \
src/tavolo/app.py \
src/tavolo/config.py \
src/tavolo/static.py \
src/tavolo/aerich_config.py \
src/tavolo/logging_config.py
End-to-end coverage of the wired stack lives in server/tests/.