diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-12-08 15:40:32 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-12-08 15:40:32 +0300 |
commit | 926c3bef9fbda49d5cab268bcd83355142e945c1 (patch) | |
tree | 1dc2b7eb13485f0fc656cc913ca56e57b672b62a /config | |
parent | 1a10945066d0da1801bb4cf89ce5f54996f1756f (diff) | |
parent | f5430e48b42227f1c1874ca27c6907f0f704be28 (diff) |
Merge branch 'master' into reference-pipeline-and-caching
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" |