mirror of
https://github.com/we-promise/sure.git
synced 2026-05-12 07:05:00 +00:00
Tighten retry exhaustion state handling
Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com> Agent-Logs-Url: https://github.com/we-promise/sure/sessions/ea7a06f4-8344-4a00-877a-eda8cdfdc16a
This commit is contained in:
@@ -108,7 +108,7 @@ class Sync < ApplicationRecord
|
||||
# Retry exhaustion can leave the sync in `pending` because we reset it
|
||||
# after each rate-limit error to make the next ActiveJob retry retryable.
|
||||
start! if pending?
|
||||
fail! if may_fail?
|
||||
fail!
|
||||
update!(error: error_message)
|
||||
end
|
||||
|
||||
@@ -167,7 +167,8 @@ class Sync < ApplicationRecord
|
||||
def reset_for_retry!
|
||||
# We intentionally bypass callbacks/state events here so the same sync record
|
||||
# can become retryable again without firing post-sync hooks or extra
|
||||
# transition side effects while the job is being retried.
|
||||
# transition side effects while the TwelveData rate-limit error is being
|
||||
# re-raised back to `SyncJob.retry_on`.
|
||||
update_columns(
|
||||
status: "pending",
|
||||
error: nil,
|
||||
|
||||
Reference in New Issue
Block a user