[rubygems/rubygems] Set thread configurations inside block
https://github.com/rubygems/rubygems/commit/860b145359
This commit is contained in:
parent
afca1a31d0
commit
db80e947a3
@ -34,14 +34,14 @@ module Gem::GemcutterUtilities
|
||||
|
||||
def self.listener_thread(host, server)
|
||||
thread = Thread.new do
|
||||
Thread.abort_on_exception = true
|
||||
Thread.report_on_exception = false
|
||||
Thread.current[:otp] = new(host).wait_for_otp_code(server)
|
||||
rescue Gem::WebauthnVerificationError => e
|
||||
Thread.current[:error] = e
|
||||
ensure
|
||||
server.close
|
||||
end
|
||||
thread.abort_on_exception = true
|
||||
thread.report_on_exception = false
|
||||
|
||||
thread
|
||||
end
|
||||
|
@ -33,12 +33,12 @@ module Gem::GemcutterUtilities
|
||||
|
||||
def self.poll_thread(options, host, webauthn_url, credentials)
|
||||
thread = Thread.new do
|
||||
Thread.abort_on_exception = true
|
||||
Thread.report_on_exception = false
|
||||
Thread.current[:otp] = new(options, host).poll_for_otp(webauthn_url, credentials)
|
||||
rescue Gem::WebauthnVerificationError, Timeout::Error => e
|
||||
Thread.current[:error] = e
|
||||
end
|
||||
thread.abort_on_exception = true
|
||||
thread.report_on_exception = false
|
||||
|
||||
thread
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user