diff options
author | Alex Hanselka <alex@gitlab.com> | 2018-12-11 00:42:50 +0300 |
---|---|---|
committer | Alex Hanselka <alex@gitlab.com> | 2018-12-11 00:42:50 +0300 |
commit | f77888fe0857c9f4a47133f434c741a510946767 (patch) | |
tree | b227b60894474ba2c9a8864b66e4df65763b35b8 /lib/gitlab/sidekiq_middleware/correlation_injector.rb | |
parent | d2120ff1e705799752e7d9704cae3f1896d8e186 (diff) | |
parent | 2d7dc668506a0576e231fbe290c89e47cf088300 (diff) |
Merge branch '11-6-stable-prepare-rc5' into '11-6-stable'
Prepare 11.6 RC5 release
See merge request gitlab-org/gitlab-ce!23704
Diffstat (limited to 'lib/gitlab/sidekiq_middleware/correlation_injector.rb')
-rw-r--r-- | lib/gitlab/sidekiq_middleware/correlation_injector.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/sidekiq_middleware/correlation_injector.rb b/lib/gitlab/sidekiq_middleware/correlation_injector.rb new file mode 100644 index 00000000000..b807b3a03ed --- /dev/null +++ b/lib/gitlab/sidekiq_middleware/correlation_injector.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Gitlab + module SidekiqMiddleware + class CorrelationInjector + def call(worker_class, job, queue, redis_pool) + job[Gitlab::CorrelationId::LOG_KEY] ||= + Gitlab::CorrelationId.current_or_new_id + + yield + end + end + end +end |