diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-12-07 21:53:59 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-12-07 21:53:59 +0300 |
commit | 1da71fa9ed4513d966a5824382fc87be4f0fb307 (patch) | |
tree | 2645a269fde93fbb5665d6683aaff93e4515edcd /config | |
parent | 24c7eafb295a292ed5eb166688d638f7d3278261 (diff) | |
parent | 496870ddec632ae13cff8b5e8f6ca0bff0fa3ec7 (diff) |
Merge branch 'feature/sidekiq-cron' into 'master'
Migrate from Sidetiq to Sidekiq-cron
Migrate from Sidetiq to Sidekiq-cron
Updated Sidekiq to 3.5.x
This will solve #2355
See merge request !1982
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/sidekiq.rb | 6 | ||||
-rw-r--r-- | config/routes.rb | 1 | ||||
-rw-r--r-- | config/schedule.yml | 10 |
3 files changed, 17 insertions, 0 deletions
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index e856499732e..6e5701e33da 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -17,6 +17,12 @@ Sidekiq.configure_server do |config| chain.add Gitlab::SidekiqMiddleware::ArgumentsLogger if ENV['SIDEKIQ_LOG_ARGUMENTS'] chain.add Gitlab::SidekiqMiddleware::MemoryKiller if ENV['SIDEKIQ_MEMORY_KILLER_MAX_RSS'] end + + # Sidekiq-cron: load recurring jobs from schedule.yml + schedule_file = 'config/schedule.yml' + if File.exists?(schedule_file) + Sidekiq::Cron::Job.load_from_hash YAML.load_file(schedule_file) + end end Sidekiq.configure_client do |config| diff --git a/config/routes.rb b/config/routes.rb index fdd387fd184..3b151891a6b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,5 @@ require 'sidekiq/web' +require 'sidekiq/cron/web' require 'api/api' Rails.application.routes.draw do diff --git a/config/schedule.yml b/config/schedule.yml new file mode 100644 index 00000000000..993a95fef56 --- /dev/null +++ b/config/schedule.yml @@ -0,0 +1,10 @@ +# Here is a list of jobs that are scheduled to run periodically. +# We use a UNIX cron notation to specify execution schedule. +# +# Please read here for more information: +# https://github.com/ondrejbartas/sidekiq-cron#adding-cron-job + +stuck_ci_builds_worker: + cron: "0 0 * * *" + class: "StuckCiBuildsWorker" + queue: "default" |