diff --git a/doc/development/sidekiq/index.md b/doc/development/sidekiq/index.md index 15cbca16df5ed4eb500ddbb21e762e7f1ecc6d68..1e097b668472a0c839a614665374eb41b3cbcd74 100644 --- a/doc/development/sidekiq/index.md +++ b/doc/development/sidekiq/index.md @@ -132,12 +132,16 @@ If you need to perform an action when a job fails after all of its retry attempt ```ruby sidekiq_retries_exhausted do |msg, ex| - project = Project.find(msg['args'].first) + project = Project.find_by_id(msg['args'].first) + return unless project + project.perform_a_rollback # handle the permanent failure end def perform(project_id) - project = Project.find(project_id) + project = Project.find_by_id(project_id) + return unless project + project.some_action # throws an exception end ```