![]() * Use sessionmaker instead of context block Essentially there were two bugs: 1) The logging lines before explicit `Session.begin` caused the root "A transaction is already begun on this Session.", which is resolved by moving the logging within the explicit session block, as intended. 2) We were reusing a Session across cron runs. The architecture was intended to not do so, but we didn't have an actual sessionmaker available to cron. We probably ought to get rid of scoped_session elsewhere, but baby steps to resolve the immediate issue. In testing, this works correctly with the fix to `db.begin`, and tests with deliberately reintroducing the logging bug, the changes to session creation prevent the every-15sec stack trace spam. --------- Almost-entirely-authored-by: TLSM <duolsm@outlook.com> |
||
---|---|---|
.. | ||
__init__.py | ||
cron.py | ||
cron_setup.py | ||
seed_db.py | ||
volunteer_janitor_recalc.py |