Skip to content

Dynamic scheduled tasks #553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cupatea
Copy link

@cupatea cupatea commented Apr 23, 2025

This pull request closes [#186] and brings in a resque-scheduler style dynamic schedules feature, allowing you to add or remove recurring tasks at runtime without touching your static config file.

What’s new:

  • Dynamic scope (static: false) on SolidQueue::RecurringTask model.
  • Renamed methods/vars in SolidQueue::Scheduler::RecurringSchedule to distinguish static vs. dynamic schedules.
  • On boot, @configured_tasks now includes both static and dynamic tasks.
  • Added SolidQueue::Scheduler::RecurringSchedule.update_scheduled_tasks:
    • Schedules any new dynamic tasks added since the last run.
    • Unschedules any dynamic tasks removed from the database.
    • Refreshes @configured_tasks to match the current DB state.
  • SolidQueue::Configuration no longer requires a non-blank static config file - pure dynamic scheduling is now supported.
  • SolidQueue::Scheduler watches for changes after launch and updates its metadata so the running process always reflects the true set of recurring tasks.

Tests verify that adding or dropping dynamic tasks at runtime correctly updates what’s scheduled.

@cupatea cupatea force-pushed the feature/dynamic_recurring_tasks branch 2 times, most recently from ed10591 to ebb8716 Compare April 23, 2025 21:17
@cupatea cupatea force-pushed the feature/dynamic_recurring_tasks branch from ebb8716 to ebd9629 Compare April 24, 2025 08:54
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.

1 participant