diff options
Diffstat (limited to 'app/workers/concerns/cronjob_queue.rb')
-rw-r--r-- | app/workers/concerns/cronjob_queue.rb | 10 |
1 files changed, 10 insertions, 0 deletions
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 |