Skip to content

Detect updates to dynamic recurring tasks on poll#739

Open
cupatea wants to merge 1 commit intorails:mainfrom
cupatea:detect-dynamic-recurring-task-updates
Open

Detect updates to dynamic recurring tasks on poll#739
cupatea wants to merge 1 commit intorails:mainfrom
cupatea:detect-dynamic-recurring-task-updates

Conversation

@cupatea
Copy link
Copy Markdown
Contributor

@cupatea cupatea commented Apr 20, 2026

Fixes #738

Scheduler::RecurringSchedule#reschedule_dynamic_tasks previously only detected created and deleted dynamic tasks. Updates to an existing task's were ignored, so the scheduler kept running against the pre-update version until restart.

Approach:

Each entry in scheduled_tasks is now a ScheduledRecurringTask struct that pairs the Concurrent::ScheduledTask handle with the source RecurringTask AR record:

ScheduledRecurringTask = Struct.new(:task, :handle) do
  delegate :key, :updated_at, to: :task
  delegate :cancel, to: :handle
end

Add new stepreschedule_dynamic_tasks that replaces any tasks with updated_at differs from the cached ones.

@cupatea
Copy link
Copy Markdown
Contributor Author

cupatea commented Apr 20, 2026

Hey @rosa, during release testing with Solid Queue dynamic tasks (#553), QA identified an issue that seems to have been missed in the initial implementation.
We’ve applied the same fix as a patch on our side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Updates to dynamic recurring tasks aren't picked up until the scheduler restarts

1 participant