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

Remove global session object #24

Merged
merged 1 commit into from
Jan 23, 2024
Merged

Remove global session object #24

merged 1 commit into from
Jan 23, 2024

Conversation

JBorrow
Copy link
Member

@JBorrow JBorrow commented Jan 22, 2024

Fixes #12

@JBorrow JBorrow requested a review from plaplant January 22, 2024 19:39
@JBorrow
Copy link
Member Author

JBorrow commented Jan 22, 2024

Throughout the codebase this now uses the pattern:

from librarian_server.database import get_session

with get_session() as session:
  session.do_stuff()

Rather than using one global session object.

@JBorrow JBorrow linked an issue Jan 22, 2024 that may be closed by this pull request
Copy link
Member

@plaplant plaplant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks @JBorrow!

@plaplant plaplant merged commit 69732c1 into librarian-v2 Jan 23, 2024
3 checks passed
@JBorrow JBorrow deleted the JBorrow/issue12 branch January 23, 2024 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Global session object is bad practice
2 participants