-
Notifications
You must be signed in to change notification settings - Fork 4
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
Bugfix/improve db sessions #204
Conversation
Conflicts: datagateway_api/src/main.py poetry.lock
Codecov Report
@@ Coverage Diff @@
## master #204 +/- ##
==========================================
- Coverage 87.25% 87.10% -0.16%
==========================================
Files 28 27 -1
Lines 2221 2225 +4
Branches 192 193 +1
==========================================
Hits 1938 1938
- Misses 242 246 +4
Partials 41 41
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with these changes - I've tested them locally and on preprod and didn't experiences any issues on either.
- When running the API, it was difficult to distinguish between the AuthenticationError affected in this commit, and the one a couple of lines above it
Description
These are the changes to improve the session handling that have been on preprod for months. Essentially, the
session_manager
object was flawed, and reading the session docs for SQLAlchemy (https://docs.sqlalchemy.org/en/13/orm/contextual.html), and it suggests using an "off-the-shelf" solution in Flask-SQLAlchemy if we're unfamiliar with session handling/threading. I tried it as a quick fix, and it seems a lot more stable, so it's easier to just import Flask-SQLAlchemy purely for its session handling than to try and fix the original solution.Testing Instructions