rDrama/files/commands
Ben Rog-Wilhelm c2eeb8b3e7
Fix: Issue where cron would end up in nested transaction blocks and unable to escape. (#586)
* 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>
2023-05-01 04:25:05 -05:00
..
__init__.py [#72] Add seed_db command 2022-06-09 01:33:58 -07:00
cron.py Fix: Issue where cron would end up in nested transaction blocks and unable to escape. (#586) 2023-05-01 04:25:05 -05:00
cron_setup.py Implement mod-viewable janitor-generated badness stats. 2023-04-30 02:08:07 -05:00
seed_db.py remove holes (#492) 2023-04-01 00:13:30 -05:00
volunteer_janitor_recalc.py Move tabulate import into local functions. 2023-04-30 02:14:55 -05:00