From 983a0bba5d2a042c4a3bbb22432ec192c7501d82 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 20 Apr 2020 18:38:24 +0000 Subject: Add latest changes from gitlab-org/gitlab@12-10-stable-ee --- app/workers/concerns/cronjob_queue.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/workers/concerns') diff --git a/app/workers/concerns/cronjob_queue.rb b/app/workers/concerns/cronjob_queue.rb index 25ee4539cab..955387b5ad4 100644 --- a/app/workers/concerns/cronjob_queue.rb +++ b/app/workers/concerns/cronjob_queue.rb @@ -10,4 +10,14 @@ module CronjobQueue sidekiq_options retry: false worker_context project: nil, namespace: nil, user: nil end + + class_methods do + # Cronjobs never get scheduled with arguments, so this is safe to + # override + def context_for_arguments(_args) + return if Gitlab::ApplicationContext.current_context_include?('meta.caller_id') + + Gitlab::ApplicationContext.new(caller_id: "Cronjob") + end + end end -- cgit v1.2.1