DEV: Upgrade Sidekiq to 6.5 (#17142)

This commit is contained in:
Alan Guo Xiang Tan 2022-06-21 09:23:36 +08:00 committed by GitHub
parent 54a518b21d
commit 3562c598ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 11 deletions

View File

@ -450,7 +450,7 @@ GEM
activesupport (>= 3.1)
shoulda-matchers (5.1.0)
activesupport (>= 5.2.0)
sidekiq (6.4.2)
sidekiq (6.5.1)
connection_pool (>= 2.2.2)
rack (~> 2.0)
redis (>= 4.2.0)
@ -637,4 +637,4 @@ DEPENDENCIES
yaml-lint
BUNDLED WITH
2.3.13
2.3.16

View File

@ -9,11 +9,6 @@ module Discourse
DB_POST_MIGRATE_PATH ||= "db/post_migrate"
REQUESTED_HOSTNAME ||= "REQUESTED_HOSTNAME"
require 'sidekiq/exception_handler'
class SidekiqExceptionHandler
extend Sidekiq::ExceptionHandler
end
class Utils
URI_REGEXP ||= URI.regexp(%w{http https})
@ -168,7 +163,7 @@ module Discourse
return if ex.class == Jobs::HandledExceptionWrapper
context ||= {}
parent_logger ||= SidekiqExceptionHandler
parent_logger ||= Sidekiq
cm = RailsMultisite::ConnectionManagement
parent_logger.handle_exception(ex, {

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
class SidekiqLogsterReporter < Sidekiq::ExceptionHandler::Logger
class SidekiqLogsterReporter
def call(ex, context = {})
return if Jobs::HandledExceptionWrapper === ex

View File

@ -321,8 +321,9 @@ describe Discourse do
context "#handle_exception" do
class TempSidekiqLogger < Sidekiq::ExceptionHandler::Logger
class TempSidekiqLogger
attr_accessor :exception, :context
def call(ex, ctx)
self.exception = ex
self.context = ctx
@ -332,10 +333,13 @@ describe Discourse do
let!(:logger) { TempSidekiqLogger.new }
before do
Sidekiq.error_handlers.clear
Sidekiq.error_handlers << logger
end
after do
Sidekiq.error_handlers.delete(logger)
end
it "should not fail when called" do
exception = StandardError.new