Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves #953 Adds 5 retires for each email which appear in a tab in the web resque UI. Adding rety on mailers and all other jobs Removing resque-rollbar as we don't need to send errors async to Rollbar.
- Loading branch information
Showing
6 changed files
with
48 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
concurrency: medium=1, mailers=1, resque_web=1, sunspot=1 | ||
concurrency: medium=1, mailers=1, resque_web=1, sunspot=1, resque_scheduler=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,32 @@ | ||
# frozen_string_literal: true | ||
|
||
require "resque/server" | ||
require "resque/failure/multiple" | ||
require "resque-retry" | ||
require "resque-retry/server" | ||
require "resque/failure/redis" | ||
require "resque/rollbar" | ||
|
||
Resque::Failure::Multiple.classes = [Resque::Failure::Redis, Resque::Failure::Rollbar] | ||
Resque::Failure.backend = Resque::Failure::Multiple | ||
# Enable resque-retry failure backend. | ||
Resque::Failure::MultipleWithRetrySuppression.classes = [Resque::Failure::Redis] | ||
Resque::Failure.backend = Resque::Failure::MultipleWithRetrySuppression | ||
|
||
Resque.redis.namespace = "resque:Cyclescape" | ||
Resque.inline = true if Rails.env.test? | ||
Resque.before_fork = proc { ActiveRecord::Base.establish_connection } | ||
|
||
Resque.after_fork do | ||
defined?(ActiveRecord::Base) && ActiveRecord::Base.establish_connection | ||
end | ||
|
||
Resque.before_fork do | ||
defined?(ActiveRecord::Base) && ActiveRecord::Base.connection.disconnect! | ||
end | ||
|
||
module ActionMailer | ||
class DeliveryJob | ||
retry_on StandardError, wait: :exponentially_longer, attempts: 5 | ||
end | ||
end | ||
|
||
module ActiveJob | ||
class Base | ||
retry_on StandardError, wait: :exponentially_longer, attempts: 5 | ||
end | ||
end |