summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-12-22 15:47:50 +0000
committerDouwe Maan <douwe@gitlab.com>2015-12-22 15:47:50 +0000
commit2309f339c60cc6b9e9e79dba9c745a8ccb5b324c (patch)
tree48fd95ee55666f3c855dc5c31b8710eef2756596
parent347c1136c2e72d9e596c9ade6ac4257f34d943e2 (diff)
parenta7a52f75671025e7c9f2a0c130a510b8425c3e4d (diff)
downloadgitlab-ce-2309f339c60cc6b9e9e79dba9c745a8ccb5b324c.tar.gz
Merge branch 'hotfix/sidekiq-cron-config' into 'master'
Hotfix for sidekiq-cron being loaded from Settingslogic with defaults This fixes a regression with "Stack level too deep" from master. See merge request !2173
-rw-r--r--config/initializers/1_settings.rb2
-rw-r--r--config/initializers/sidekiq.rb6
2 files changed, 6 insertions, 2 deletions
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index b581a9e4bd6..816cb0c02a9 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -234,7 +234,7 @@ Settings.gravatar['host'] = Settings.get_host_without_www(Settings.grava
Settings['cron_jobs'] ||= Settingslogic.new({})
Settings.cron_jobs['stuck_ci_builds_worker'] ||= Settingslogic.new({})
Settings.cron_jobs['stuck_ci_builds_worker']['cron'] ||= '0 0 * * *'
-Settings.cron_jobs['stuck_ci_builds_worker']['class'] = 'StuckCiBuildsWorker'
+Settings.cron_jobs['stuck_ci_builds_worker']['job_class'] = 'StuckCiBuildsWorker'
#
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb
index b42b718a7db..dcf6ce74d96 100644
--- a/config/initializers/sidekiq.rb
+++ b/config/initializers/sidekiq.rb
@@ -19,7 +19,11 @@ Sidekiq.configure_server do |config|
end
# Sidekiq-cron: load recurring jobs from gitlab.yml
- Sidekiq::Cron::Job.load_from_hash! Gitlab.config.cron_jobs
+ # UGLY Hack to get nested hash from settingslogic
+ cron_jobs = JSON.parse(Gitlab.config.cron_jobs.to_json)
+ # UGLY hack: Settingslogic doesn't allow 'class' key
+ cron_jobs.each { |k,v| cron_jobs[k]['class'] = cron_jobs[k].delete('job_class') }
+ Sidekiq::Cron::Job.load_from_hash! cron_jobs
# Database pool should be at least `sidekiq_concurrency` + 2
# For more info, see: https://github.com/mperham/sidekiq/blob/master/4.0-Upgrade.md