Always catch StandardError in Threads and release connection
This commit is contained in:
@ -19,6 +19,8 @@ module Prometheus
|
||||
initialize_rfc_metrics
|
||||
rescue StandardError => e
|
||||
Sentry.capture_exception(e)
|
||||
ensure
|
||||
ActiveRecord::Base.connection_pool.release_connection
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -32,6 +32,8 @@ class Runner::EventLoop
|
||||
queue = Queue.new
|
||||
Thread.new do
|
||||
EventMachine.run { queue.push nil }
|
||||
rescue StandardError => e
|
||||
Sentry.capture_exception(e)
|
||||
ensure
|
||||
ActiveRecord::Base.connection_pool.release_connection
|
||||
end
|
||||
|
Reference in New Issue
Block a user