mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
DEV: Upgrade Sidekiq to 6.5 (#17142)
This commit is contained in:
parent
54a518b21d
commit
3562c598ef
|
@ -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
|
||||
|
|
|
@ -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, {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class SidekiqLogsterReporter < Sidekiq::ExceptionHandler::Logger
|
||||
class SidekiqLogsterReporter
|
||||
def call(ex, context = {})
|
||||
|
||||
return if Jobs::HandledExceptionWrapper === ex
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user