diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2022-04-28 17:47:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-28 17:47:34 +0200 |
commit | 3917353645b91dae04f7d9b81162fead6f73072a (patch) | |
tree | 202cbf93dfa378c26a291900ea65ec088ee5b5cc /lib/sidekiq_error_handler.rb | |
parent | 9bf04db23acf10e05ffdf7def06c246081f8f065 (diff) |
Fix single Redis connection being used across all threads (#18135)
* Fix single Redis connection being used across all Sidekiq threads * Fix tests
Diffstat (limited to 'lib/sidekiq_error_handler.rb')
-rw-r--r-- | lib/sidekiq_error_handler.rb | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/sidekiq_error_handler.rb b/lib/sidekiq_error_handler.rb deleted file mode 100644 index 358afd540..000000000 --- a/lib/sidekiq_error_handler.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class SidekiqErrorHandler - BACKTRACE_LIMIT = 3 - - def call(*) - yield - rescue Mastodon::HostValidationError - # Do not retry - rescue => e - limit_backtrace_and_raise(e) - ensure - socket = Thread.current[:statsd_socket] - socket&.close - Thread.current[:statsd_socket] = nil - end - - private - - def limit_backtrace_and_raise(exception) - exception.set_backtrace(exception.backtrace.first(BACKTRACE_LIMIT)) - raise exception - end -end |