Skip to content

Commit

Permalink
fix: установит правильный бэкэнд, если notifier не включен
Browse files Browse the repository at this point in the history
  • Loading branch information
spyderdfx committed Apr 26, 2016
1 parent 8717eb9 commit 0f598e2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/resque/integration/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,18 @@ class Engine < Rails::Engine

# Глушим ошибки, по которым происходит автоматический перезапуск
initializer 'resque-integration.retrys' do
require 'resque/failure'
require 'resque/failure/redis'

Resque::Failure::MultipleWithRetrySuppression.classes = [Resque::Failure::Redis]

if Resque.config.failure_notifier.enabled?
require 'resque_failed_job_mailer'
require 'resque/failure'
require 'resque/failure/redis'

Resque::Failure::MultipleWithRetrySuppression.classes = [Resque::Failure::Redis, Resque::Failure::Notifier]
Resque::Failure.backend = Resque::Failure::MultipleWithRetrySuppression
Resque::Failure::MultipleWithRetrySuppression.classes << Resque::Failure::Notifier
end

Resque::Failure.backend = Resque::Failure::MultipleWithRetrySuppression
end

initializer "resque-integration.extensions" do
Expand Down

0 comments on commit 0f598e2

Please sign in to comment.