mirror of
https://github.com/gitlabhq/gitlabhq.git
synced 2025-08-20 16:30:26 +00:00
18 lines
405 B
Ruby
18 lines
405 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Gitlab
|
|
module SidekiqProcess
|
|
class << self
|
|
def pid
|
|
# The sidekiq thread-local capsule is set in the Processor.
|
|
# https://github.com/sidekiq/sidekiq/blob/v7.2.4/lib/sidekiq/processor.rb#L70
|
|
Thread.current[:sidekiq_capsule]&.identity
|
|
end
|
|
|
|
def tid
|
|
Thread.current[:sidekiq_capsule]&.tid
|
|
end
|
|
end
|
|
end
|
|
end
|