Skip to content

Add option to skip recurring jobs via environment variable #580

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

Merged
merged 1 commit into from
Jun 28, 2025

Conversation

iamradioactive
Copy link
Contributor

@iamradioactive iamradioactive commented Jun 17, 2025

Closes #558

Problem
Users need a way to disable recurring jobs in specific environments (staging, review apps, development) without modifying configuration files or CLI commands. This is particularly useful for:

  • Staging environments where you don't want production cron jobs running
  • Review/preview apps that should focus on testing features, not running scheduled tasks
  • Development environments where recurring jobs might interfere with testing

Solution

  • Adds support for the SOLID_QUEUE_SKIP_RECURRING environment variable that mirrors the existing --skip-recurring CLI option functionality.

Changes

  • Configuration: Modified default_options in Configuration class to read SOLID_QUEUE_SKIP_RECURRING environment variable
  • Tests: Added test coverage with new with_env test helper
  • Documentation: Updated README with usage examples and use cases

Usage

SOLID_QUEUE_SKIP_RECURRING=true bin/jobs

@iamradioactive iamradioactive force-pushed the conditionally-skip-recurring-jobs branch from 85f0a58 to 25ac493 Compare June 17, 2025 13:59
@iamradioactive
Copy link
Contributor Author

iamradioactive commented Jun 21, 2025

Checks are failing because of an unrelated single integration spec which is seen failing on main branch too.

Reference: https://github.com/rails/solid_queue/actions/runs/15707068967/job/44255312757

@rosa
Copy link
Member

rosa commented Jun 28, 2025

Checks are failing because of an unrelated single integration spec which is seen failing on main branch too.

Yes, it's due to a bug in Rails's main, they only fail with rails_main.

Copy link
Member

@rosa rosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@rosa rosa merged commit e04c1f9 into rails:main Jun 28, 2025
132 of 172 checks passed
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.

Add environment variable to turn off recurring jobs
2 participants