Skip to content

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

@cupatea

Description

@cupatea

When dynamic tasks enabled, only two cases are handled on each poll:

  • Creating new recurring task
  • Deleting existing recurring task

The third case, when task updated is not handled. If dynamic task's schedule changed, arguments, queue_name, priority, class_name, etc., the running scheduler keeps firing against the pre-update version until the process is restarted.

Example:

task = SolidQueue.schedule_recurring_task(
  "platform-import-schedule-14",
  class: "PlatformlmportJob",
  args: [{ company_id: 14 }],
  schedule: "0 4 * * * Europe/Kyiv" # 04:00 EEST
)

# scheduler picks it up on the next poll

task.update!(schedule: "0 8 * * * Europe/Kyiv") # 08:00 EEST

# expected: jobs start at 08:00 EEST
# actual:   scheduler keeps the original "04:00 EEST" cadence until restart
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions