Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX: Prevent race condition in recurring automations (#26828)
Recurring automations are triggered by a scheduled job that runs every minute and checks for due automations, runs them and then marks as them as completed (by deleting the `PendingAutomation` record). However, the job is currently subject to a race condition where a recurring automation can be executed more than once at its due date if it takes more than a minute to finish. This commit adds a mutex around the code that triggers the recurring automation so that no concurrent executions can happen for a single automation. Meta topic: https://meta.discourse.org/t/daily-summary-9pm-utc/291850/119?u=osama.
- Loading branch information
1 parent
d1f008a
commit 8ed6843
Showing
2 changed files
with
79 additions
and
13 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