summaryrefslogtreecommitdiff
path: root/config/initializers
diff options
context:
space:
mode:
authorGabriel Mazetto <gabriel@gitlab.com>2015-12-12 23:06:23 -0200
committerGabriel Mazetto <gabriel@gitlab.com>2015-12-14 14:17:20 -0200
commit51ef4a2fed382833833f15afae1da3f98bfa5031 (patch)
tree00162d3dd3babadd7b137d2a3672fedc799cf7cb /config/initializers
parenta5e449571bb941d65d33569a0f0db575a5b3d399 (diff)
downloadgitlab-ce-51ef4a2fed382833833f15afae1da3f98bfa5031.tar.gz
Sidekiq-cron configuration moved to gitlab.ymlfeature/sidekiq-cron-config
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/1_settings.rb9
-rw-r--r--config/initializers/sidekiq.rb7
2 files changed, 11 insertions, 5 deletions
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index 63d8ae17436..37b92d07946 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -225,6 +225,15 @@ Settings.gravatar['ssl_url'] ||= 'https://secure.gravatar.com/avatar/%{hash}?
Settings.gravatar['host'] = Settings.get_host_without_www(Settings.gravatar['plain_url'])
#
+# Cron Jobs
+#
+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'
+
+
+#
# GitLab Shell
#
Settings['gitlab_shell'] ||= Settingslogic.new({})
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb
index 2e3a71912ef..b42b718a7db 100644
--- a/config/initializers/sidekiq.rb
+++ b/config/initializers/sidekiq.rb
@@ -18,11 +18,8 @@ Sidekiq.configure_server do |config|
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
+ # Sidekiq-cron: load recurring jobs from gitlab.yml
+ Sidekiq::Cron::Job.load_from_hash! Gitlab.config.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