Skip to content

Add rake task to enable or disable sidekiq cron jobs

What does this MR do and why?

Add rake task to enable or disable sidekiq cron jobs. The task uses Sidekiq::Cron::Job.all.map(&:enable!) to enable cron jobs and disable them.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After disable After enable again
No task ran Command bundle exec rails gitlab:sidekiq:cron:disable bundle exec rails gitlab:sidekiq:cron:enable
Screenshot_2023-09-20_at_9.10.58 Screenshot_2023-09-20_at_9.08.06 Screenshot_2023-09-20_at_9.10.58

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Visit any Admin>Monitoring>Background jobs https://gdk.test:3443/admin/background_jobs
  2. Run bundle exec rails gitlab:sidekiq:cron:disable
  3. Refresh any Admin>Monitoring>Background jobs https://gdk.test:3443/admin/background_jobs
  4. Run bundle exec rails gitlab:sidekiq:cron:enable
  5. Refresh any Admin>Monitoring>Background jobs https://gdk.test:3443/admin/background_jobs

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #296981

Merge request reports