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

[refactor] improve the gorm transaction that covers flag snapshot in crud logic #355

Closed
zhouzhuojie opened this issue Apr 10, 2020 · 1 comment

Comments

@zhouzhuojie
Copy link
Collaborator

Some of the database logic is not wrapped into a transaction in crud.go, for example, https://github.com/checkr/flagr/blob/848bcf07b8ff4f6a4a056794d521c62535b2e3b8/pkg/handler/crud.go#L424

Expected Behavior

Ideally, all the database logic of a request can be wrapped into a transaction to avoid data corruption.

Current Behavior

Possible Solution

Use db.Transaction(func(tx *gorm.DB) error {
https://gorm.io/docs/transactions.html#Transactions

@github-actions
Copy link

Stale issue message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant