-
Notifications
You must be signed in to change notification settings - Fork 27
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
♻️ refactor RUT to use new transactional context #6874
♻️ refactor RUT to use new transactional context #6874
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6874 +/- ##
===========================================
- Coverage 88.33% 65.74% -22.59%
===========================================
Files 1546 669 -877
Lines 60975 33938 -27037
Branches 2095 318 -1777
===========================================
- Hits 53862 22314 -31548
- Misses 6781 11564 +4783
+ Partials 332 60 -272
Continue to review full report in Codecov by Sentry.
|
...ker/src/simcore_service_resource_usage_tracker/services/modules/db/credit_transactions_db.py
Show resolved
Hide resolved
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.
Please be very carful when doing these changes. You have correctly awaited the execute part of the query, which is correct. But after an execute you are returned a cursor.
Each time you interact with a cursor it communicates to the DB.
The operations scalar
, first
, fetch_all
they all interact with the cursor. Please replace them with he await
versions, which usually just implies in awaiting on the same method.
...ker/src/simcore_service_resource_usage_tracker/services/modules/db/credit_transactions_db.py
Show resolved
Hide resolved
...ker/src/simcore_service_resource_usage_tracker/services/modules/db/credit_transactions_db.py
Show resolved
Hide resolved
...ker/src/simcore_service_resource_usage_tracker/services/modules/db/credit_transactions_db.py
Show resolved
Hide resolved
...ker/src/simcore_service_resource_usage_tracker/services/modules/db/credit_transactions_db.py
Show resolved
Hide resolved
...e-tracker/src/simcore_service_resource_usage_tracker/services/modules/db/pricing_plans_db.py
Show resolved
Hide resolved
...ge-tracker/src/simcore_service_resource_usage_tracker/services/modules/db/service_runs_db.py
Show resolved
Hide resolved
...ge-tracker/src/simcore_service_resource_usage_tracker/services/modules/db/service_runs_db.py
Show resolved
Hide resolved
...ge-tracker/src/simcore_service_resource_usage_tracker/services/modules/db/service_runs_db.py
Show resolved
Hide resolved
...ge-tracker/src/simcore_service_resource_usage_tracker/services/modules/db/service_runs_db.py
Show resolved
Hide resolved
...ge-tracker/src/simcore_service_resource_usage_tracker/services/modules/db/service_runs_db.py
Show resolved
Hide resolved
Discussed in person. There are two approaches: either the one I have, which buffers the results into memory, or the one that streams the results, where fetching also needs to be awaited. |
...ker/src/simcore_service_resource_usage_tracker/services/modules/db/credit_transactions_db.py
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
What do these changes do?
ResourceTrackerRepository
and rather introduced three db modules:credit_transactions_db
,pricing_plans_db
,service_runs_db
Related issue/s
How to test
Dev-ops checklist