Slide 18
Slide 18 text
ジョブクラスにContinuationsの設定を書く
class SomethingJob < ApplicationJob
self.resume_options = { wait: 1.seconds, queue: :resumed }
self.max_resumptions = 3
wait(再開までの時間): デフォルトは5.seconds
queue(中断時に入れるキュー): デフォルトは初回と同じ
max_resumptions(最大再開回数): デフォルトはnil、無制限に再開可能
注意: ActiveJobには以前からContinuations機能とは別のリトライ機能がある
リトライ設定 retry_on StandardError, attempts: 3
と組み合わせ注意
retry_jobメソッド: Continuations機能の中断再開
retry_onメソッド: 従来のリトライ
設定値詳細: https://api.rubyonrails.org/classes/ActiveJob/Continuation.html