summaryrefslogtreecommitdiff
path: root/lib/gitlab/sidekiq_middleware/correlation_injector.rb
blob: b807b3a03edba885320a1f6560e4b813ea3b3014 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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