Skip to content

Wrap all sqlalchemy usages of session into a block#1706

Merged
sausage-todd merged 1 commit into
mainfrom
fix-python-worker
Oct 17, 2023
Merged

Wrap all sqlalchemy usages of session into a block#1706
sausage-todd merged 1 commit into
mainfrom
fix-python-worker

Conversation

@sausage-todd

@sausage-todd sausage-todd commented Oct 17, 2023

Copy link
Copy Markdown
Contributor

So we close those transactions after we don't need them

Changes proposed ✍️

What

🤖 Generated by Copilot at 1e033d0

Refactored the Repository class in the Python microservice to use scoped sessions for better database concurrency and integrity. Fixed a syntax error in a SQL query.

🤖 Generated by Copilot at 1e033d0

The Repository class had a flaw
It used a global session for all
But scoped sessions are better
They keep the data setter
And fix a syntax error so small

Why

How

🤖 Generated by Copilot at 1e033d0

  • Refactor Repository class to use scoped sessions instead of a global session object (link, link, link, link, link, link)
  • Fix a missing parenthesis in the raw SQL query of the find_all_usernames method (link)

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screehshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

So we close those transactions after we don't need them
@sausage-todd sausage-todd merged commit 6845ad5 into main Oct 17, 2023
@sausage-todd sausage-todd deleted the fix-python-worker branch October 17, 2023 10:38
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.

1 participant