Explorar el Código

Fix statsd UDP sockets not being cleaned up in Sidekiq (#11230)

master^2
Eugen Rochko hace 4 años
committed by GitHub
padre
commit
1a747f7020
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: 4AEE18F83AFDEB23
Se han modificado 1 ficheros con 5 adiciones y 3 borrados
  1. +5
    -3
      app/lib/sidekiq_error_handler.rb

+ 5
- 3
app/lib/sidekiq_error_handler.rb Ver fichero

@@ -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

Cargando…
Cancelar
Guardar