fix: prevent schedule reset when scheduling config hasn't changed#829
Merged
fix: prevent schedule reset when scheduling config hasn't changed#829
Conversation
handle_scheduling_update() unconditionally unscheduled and rescheduled flows even when the incoming config was identical to what was already set. This reset the Action Scheduler timer and triggered an immediate run every time any flow update included scheduling_config. Adds scheduling_unchanged() guard that compares incoming interval, cron_expression, or timestamp against the current DB values and returns early if nothing changed. Covers recurring, cron, one_time, and manual scheduling types.
Homeboy Results —
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
handle_scheduling_update()unconditionally unscheduled and rescheduled flows even when the incoming config was identical to what was already setfirst_runtonow(), triggering an immediate runRoot cause
Any code path that calls
UpdateFlowAbilitywithscheduling_configincluded — even with identical values — would:as_unschedule_all_actions()— kill the existing scheduleas_schedule_recurring_action(time() + stagger, ...)— create a new one starting from nowfirst_runin the DB to the new timestampThere was no check to see if the schedule was already set to the requested interval.
Fix
Adds
scheduling_unchanged()private method that compares the incoming scheduling fields against the current DB values:intervalkey (e.g.every_3_days)cron_expressionstringtimestampIf nothing changed,
handle_scheduling_update()returnstrueearly without touching Action Scheduler.Impact