summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-17 12:09:52 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-17 12:09:52 +0000
commit8ae26d705abe341b03bc15d4373d6cd0c77c0baf (patch)
tree655ee03a968e340c975b8ab7d77cfd5ceaf3c969 /app/workers
parentfc1df8c8307fc5022f9e8aae04164c089d8fdf2e (diff)
downloadgitlab-ce-8ae26d705abe341b03bc15d4373d6cd0c77c0baf.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/concerns/application_worker.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/workers/concerns/application_worker.rb b/app/workers/concerns/application_worker.rb
index 733156ab758..c0062780688 100644
--- a/app/workers/concerns/application_worker.rb
+++ b/app/workers/concerns/application_worker.rb
@@ -13,6 +13,17 @@ module ApplicationWorker
included do
set_queue
+
+ def structured_payload(payload = {})
+ context = Labkit::Context.current.to_h.merge(
+ 'class' => self.class,
+ 'job_status' => 'running',
+ 'queue' => self.class.queue,
+ 'jid' => jid
+ )
+
+ payload.stringify_keys.merge(context)
+ end
end
class_methods do