summaryrefslogtreecommitdiff
path: root/lib/gitlab/sidekiq_middleware/correlation_injector.rb
blob: 1539fd706abe64f67f9b23c0284d088dcb5f6572 (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[Labkit::Correlation::CorrelationId::LOG_KEY] ||=
          Labkit::Correlation::CorrelationId.current_or_new_id

        yield
      end
    end
  end
end