-
Notifications
You must be signed in to change notification settings - Fork 23
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
Fix/replace transaction #1192
Fix/replace transaction #1192
Conversation
Manual system tests [cancelled] with the following config
|
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## sprint-july-4 #1192 +/- ##
=================================================
+ Coverage 25.46% 25.52% +0.06%
=================================================
Files 81 81
Lines 9170 9136 -34
=================================================
- Hits 2335 2332 -3
+ Misses 6544 6514 -30
+ Partials 291 290 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Manual system tests [failure] with the following config
|
//conn := ctx.Value(ContextKeyTransaction) | ||
//if conn != nil { | ||
// return ctx | ||
//} |
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.
should we remove this section? I see this causing confusions later.
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.
for sure
tx.Commit() | ||
return nil | ||
} | ||
func (store *postgresStore) WithTransaction(ctx context.Context, f func(ctx context.Context) error) error { |
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 do not see its usage anywhere? Is this method on the store
required ?
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.
we need it, it will be used eventually
WithNewTransaction(f func(ctx context.Context) error) error | ||
WithTransaction(ctx context.Context, f func(ctx context.Context) error) error |
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.
What is the difference between these two methods? And I do not see any usage of the WithTransaction
method. Did I not check it properly? If it indeed do not have any usage, is it really required then?
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.
they are different actually
WithNewTransaction(f func(ctx context.Context) error) error
will force create new transaction and new context
WithTransaction(ctx context.Context, f func(ctx context.Context) error) error
will use existent transaction or will create the new one in given context
# Conflicts: # .github/workflows/build-&-publish-docker-image.yml
…x/replace-transaction
Changes
Fixes
Tests
Tasks to complete before merging PR:
Associated PRs (Link as appropriate):