summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-07-20 11:28:57 +0000
committerRémy Coutable <remy@rymai.me>2016-07-20 11:28:57 +0000
commit8e6fa5937be35b3b1c0907911ec9a961ccd23935 (patch)
tree4958a8aa9294d38844201a6c8c5e3dcc71e9fb68
parentc1f0b7fcf0a28110ed4465a8afed254a4e33d5ee (diff)
parentd7ab81cf7d89f3edf6515f7d954e376029a17b88 (diff)
downloadgitlab-ce-8e6fa5937be35b3b1c0907911ec9a961ccd23935.tar.gz
Merge branch 'regression/cron_jobs_validation' into 'master'
Log cron_jobs configuration instead of raising exception ## What does this MR do? Log cron_jobs configuration errors and remove invalid key <-> values from the configuration hash instead of raising an exception. This has been discussed at #20010. Fixes #20010 ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? Original implementation !5318, introduced a regression with our docker packaging: #20010. ## What are the relevant issue numbers? * #20010 * #18378 ## Does this MR meet the acceptance criteria? - [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [ ] Added for this feature/bug - [ ] All builds are passing - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] Branch has no merge conflicts with `master` (if you do - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5360
-rw-r--r--CHANGELOG2
-rw-r--r--config/initializers/sidekiq.rb3
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 1abc4afdddd..e9c86cc0bf3 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -128,7 +128,7 @@ v 8.10.0 (unreleased)
- Fix last update timestamp on issues not preserved on gitlab.com and project imports
- Fix issues importing projects from EE to CE
- Fix creating group with space in group path
- - Improve cron_jobs loading error messages !5318
+ - Improve cron_jobs loading error messages !5318 / !5360
- Create Todos for Issue author when assign or mention himself (Katarzyna Kobierska)
- Limit the number of retries on error to 3 for exporting projects
- Allow empty repositories on project import/export
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb
index b40fd81ff96..5e839327e7a 100644
--- a/config/initializers/sidekiq.rb
+++ b/config/initializers/sidekiq.rb
@@ -18,7 +18,8 @@ Sidekiq.configure_server do |config|
if cron_jobs[k] && cron_jobs_required_keys.all? { |s| cron_jobs[k].key?(s) }
cron_jobs[k]['class'] = cron_jobs[k].delete('job_class')
else
- raise("Invalid cron_jobs config key: '#{k}'. Check your gitlab config file.")
+ cron_jobs.delete(k)
+ Rails.logger.error("Invalid cron_jobs config key: '#{k}'. Check your gitlab config file.")
end
end
Sidekiq::Cron::Job.load_from_hash! cron_jobs