mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Use new Thread#name API available in Ruby 2.3+
This commit is contained in:
parent
fda7cd2493
commit
aacaa82430
2 changed files with 2 additions and 2 deletions
|
@ -160,7 +160,7 @@ module Sidekiq
|
|||
},
|
||||
"TTIN" => ->(cli) {
|
||||
Thread.list.each do |thread|
|
||||
Sidekiq.logger.warn "Thread TID-#{(thread.object_id ^ ::Process.pid).to_s(36)} #{thread["sidekiq_label"]}"
|
||||
Sidekiq.logger.warn "Thread TID-#{(thread.object_id ^ ::Process.pid).to_s(36)} #{thread.name}"
|
||||
if thread.backtrace
|
||||
Sidekiq.logger.warn thread.backtrace.join("\n")
|
||||
else
|
||||
|
|
|
@ -22,7 +22,7 @@ module Sidekiq
|
|||
|
||||
def safe_thread(name, &block)
|
||||
Thread.new do
|
||||
Thread.current["sidekiq_label"] = name
|
||||
Thread.current.name = name
|
||||
watchdog(name, &block)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue