Commit dbb147b9 authored by Gabriel Mazetto's avatar Gabriel Mazetto Committed by Gabriel Mazetto

Hotfix for sidekiq-cron being loaded from Settingslogic with defaults

parent bda5e70f
...@@ -303,7 +303,7 @@ Settings.gravatar['host'] = Settings.get_host_without_www(Settings.grava ...@@ -303,7 +303,7 @@ Settings.gravatar['host'] = Settings.get_host_without_www(Settings.grava
Settings['cron_jobs'] ||= Settingslogic.new({}) Settings['cron_jobs'] ||= Settingslogic.new({})
Settings.cron_jobs['stuck_ci_builds_worker'] ||= 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']['cron'] ||= '0 0 * * *'
Settings.cron_jobs['stuck_ci_builds_worker']['class'] = 'StuckCiBuildsWorker' Settings.cron_jobs['stuck_ci_builds_worker']['job_class'] = 'StuckCiBuildsWorker'
Settings.cron_jobs['historical_data_worker'] ||= Settingslogic.new({}) Settings.cron_jobs['historical_data_worker'] ||= Settingslogic.new({})
Settings.cron_jobs['historical_data_worker']['cron'] ||= '0 12 * * *' Settings.cron_jobs['historical_data_worker']['cron'] ||= '0 12 * * *'
Settings.cron_jobs['historical_data_worker']['class'] = 'HistoricalDataWorker' Settings.cron_jobs['historical_data_worker']['class'] = 'HistoricalDataWorker'
...@@ -314,6 +314,7 @@ Settings.cron_jobs['ldap_sync_worker'] ||= Settingslogic.new({}) ...@@ -314,6 +314,7 @@ Settings.cron_jobs['ldap_sync_worker'] ||= Settingslogic.new({})
Settings.cron_jobs['ldap_sync_worker']['cron'] ||= '30 1 * * *' Settings.cron_jobs['ldap_sync_worker']['cron'] ||= '30 1 * * *'
Settings.cron_jobs['ldap_sync_worker']['class'] = 'LdapSyncWorker' Settings.cron_jobs['ldap_sync_worker']['class'] = 'LdapSyncWorker'
# #
# GitLab Shell # GitLab Shell
# #
......
...@@ -19,7 +19,11 @@ Sidekiq.configure_server do |config| ...@@ -19,7 +19,11 @@ Sidekiq.configure_server do |config|
end end
# Sidekiq-cron: load recurring jobs from gitlab.yml # 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 # Database pool should be at least `sidekiq_concurrency` + 2
# For more info, see: https://github.com/mperham/sidekiq/blob/master/4.0-Upgrade.md # For more info, see: https://github.com/mperham/sidekiq/blob/master/4.0-Upgrade.md
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment