mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 13:41:04 +08:00
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:
@ -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"
|
||||
|
Reference in New Issue
Block a user