rDrama/files
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
..
assets Implement mod-viewable janitor-generated badness stats. 2023-04-30 02:08:07 -05:00
classes Implement mod-viewable janitor-generated badness stats. 2023-04-30 02:08:07 -05:00
commands Fix: Issue where cron would end up in nested transaction blocks and unable to escape. (#586) 2023-05-01 04:25:05 -05:00
helpers Implement mod-viewable janitor-generated badness stats. 2023-04-30 02:08:07 -05:00
mail post scheduling (#554) 2023-03-29 16:32:48 -05:00
routes Implement mod-viewable janitor-generated badness stats. 2023-04-30 02:08:07 -05:00
templates Implement mod-viewable janitor-generated badness stats. 2023-04-30 02:08:07 -05:00
tests remove holes (#492) 2023-04-01 00:13:30 -05:00
__init__.py Initial e2e testing 2022-05-13 02:55:29 -05:00
__main__.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
cli.py Implement mod-viewable janitor-generated badness stats. 2023-04-30 02:08:07 -05:00