FIX: Prevent infinite loop of automations triggering each other (#26814)

It's currently possible to setup multiple automation rules that trigger each other resulting in an infinite loop. To prevent that, this commit adds a global "circuit breaker" that prevents all automations from triggering while an automation rule is executing.

Internal topic: t/124365.
This commit is contained in:
Osama Sayegh
2024-04-30 20:13:29 +03:00
committed by GitHub
parent ff8e1f4ed6
commit 0e44072b2b
4 changed files with 72 additions and 15 deletions

View File

@ -28,6 +28,14 @@ module ::DiscourseAutomation
AUTO_RESPONDER_TRIGGERED_IDS = "auto_responder_triggered_ids"
USER_GROUP_MEMBERSHIP_THROUGH_BADGE_BULK_MODIFY_START_COUNT = 1000
def self.set_active_automation(id)
@active_automation_id = id
end
def self.get_active_automation
@active_automation_id
end
end
require_relative "lib/discourse_automation/engine"