gpt4 book ai didi

ruby-on-rails - 我在哪里放置我的 resque-retry 失败后端代码?

转载 作者:行者123 更新时间:2023-12-04 05:58:42 25 4
gpt4 key购买 nike

resque-retry gem 的 README 讨论了在实现时更改失败后端实现。

MultipleWithRetrySuppression is a multiple failure backend, with retry suppression.

Here's an example, using the Redis failure backend:

require 'resque-retry'
require 'resque/failure/redis'

# require your jobs & application code.

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

If a job fails, but can and will retry, the failure details wont be logged in the Redis failed queue (visible via resque-web).

If the job fails, but can't or won't retry, the failure will be logged in the Redis failed queue, like a normal failure (without retry) would.



我不确定该代码应该放在我的 Rails 应用程序中的哪个位置。我应该将它放入任何随机初始化文件中,例如 config/initializers/resque.rb ?或者我的应用程序中还有其他地方应该去哪里?文档不清楚。

最佳答案

看起来初始化程序是最好的选择。接受这是最好的答案,除非有人提出更好的建议。

关于ruby-on-rails - 我在哪里放置我的 resque-retry 失败后端代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10128292/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com