summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-12-08 13:43:45 +0100
committerDouwe Maan <douwe@gitlab.com>2015-12-08 13:43:45 +0100
commit75486f09c4b8f2df17e2c16bf4d97fceb34dc9ad (patch)
tree9c44f07bf4991a208b969b8bddf0b04e1edb02be /config
parente7969d6f6c743ead94b3b430b9184ad21f647337 (diff)
parentf5430e48b42227f1c1874ca27c6907f0f704be28 (diff)
downloadgitlab-ce-75486f09c4b8f2df17e2c16bf4d97fceb34dc9ad.tar.gz
Merge branch 'master' into zj/gitlab-ce-merge-if-green
Diffstat (limited to 'config')
-rw-r--r--config/initializers/sidekiq.rb6
-rw-r--r--config/routes.rb3
-rw-r--r--config/schedule.yml10
3 files changed, 18 insertions, 1 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 6bb0d31df2e..b1f34700c00 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
@@ -368,7 +369,7 @@ Rails.application.routes.draw do
end
resource :avatar, only: [:destroy]
- resources :milestones, only: [:index, :show, :update, :new, :create]
+ resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :update, :new, :create]
end
end
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"