mirror of
https://github.com/mastodon/mastodon.git
synced 2025-01-18 08:01:57 +01:00
Fix statsd UDP sockets not being cleaned up in Sidekiq (#11230)
This commit is contained in:
parent
bc60d794f8
commit
1a747f7020
@ -3,9 +3,11 @@
|
||||
class SidekiqErrorHandler
|
||||
def call(*)
|
||||
yield
|
||||
rescue Mastodon::HostValidationError => e
|
||||
Rails.logger.error "#{e.class}: #{e.message}"
|
||||
Rails.logger.error e.backtrace.join("\n")
|
||||
rescue Mastodon::HostValidationError
|
||||
# Do not retry
|
||||
ensure
|
||||
socket = Thread.current[:statsd_socket]
|
||||
socket&.close
|
||||
Thread.current[:statsd_socket] = nil
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user