discourse/plugins/automation/spec
Osama Sayegh 8ed684312f
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.
2024-05-01 09:01:58 +03:00
..
fabricators
integration FIX: Prevent infinite loop of automations triggering each other (#26814) 2024-04-30 20:13:29 +03:00
jobs FIX: Prevent race condition in recurring automations (#26828) 2024-05-01 09:01:58 +03:00
lib
models FIX: Prevent infinite loop of automations triggering each other (#26814) 2024-04-30 20:13:29 +03:00
queries
requests
scripts
serializers
services
system
triggers FIX: ensures we don't exit without pending automations (#26771) 2024-04-26 14:05:27 +02:00
discourse_automation_helper.rb