-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollback db transaction when background task is interrupted
Previously, when a task got interrupted, we let the process die immediately, which would rollback the transaction automatically. Now, we try to reset the task, which involves clearing the task started_at timestamp and then commiting the current transaction to save that change to the db. So in order to ensure that any in-progress changes from the task itself are not committed alongside those changes, we need to rollback the current transaction and start a new one. I updated the tests for task resetting to cover this behavior, which they previously didn't cover because they didn't use the db.
- Loading branch information
1 parent
f48b678
commit 5a2686b
Showing
2 changed files
with
43 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters