Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uses a scoped session for scheduler objects. #3634

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

kevgliss
Copy link
Contributor

I believe our main issue is because we are using session.close() instead of session.remove() and because each scheduled run is in it own thread we should be using scoped_session as well. This seems to work fine in my tests, but will be hard to tell for sure until we do a deployment with this code to see if it actually resolves our connection issues.

https://docs.sqlalchemy.org/en/13/orm/contextual.html#contextual-thread-local-sessions

…leaning up connections rather that just closing them.
@kevgliss kevgliss added the bug Something isn't working label Jul 31, 2023
@kevgliss kevgliss merged commit 30a3bbb into master Jul 31, 2023
8 of 9 checks passed
@kevgliss kevgliss deleted the bugfix/scheduler-database-connections branch July 31, 2023 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants