Skip to content

Commit

Permalink
workflow: do not retry AM poll activities
Browse files Browse the repository at this point in the history
This commit updates the poller activities so they convert errors that escape
the backoff retry into workflow NRE (non-retryable) errors. When these are
returned, they escape the retry policy attached to the activities.

E.g., we want the activity to give up right away when Archivematica returns the
"FAILED" status for a package.
  • Loading branch information
sevein committed Nov 7, 2019
1 parent c528595 commit 6f8e9af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/workflow/poll_ingest_activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (a *PollIngestActivity) Execute(ctx context.Context, tinfo *TransferInfo) (

err = pipeline.IngestStatus(ctx, amc, tinfo.SIPID)
if errors.Is(err, pipeline.ErrStatusNonRetryable) {
return backoff.Permanent(err)
return backoff.Permanent(nonRetryableError(err))
}

return err
Expand Down
2 changes: 1 addition & 1 deletion internal/workflow/poll_transfer_activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (a *PollTransferActivity) Execute(ctx context.Context, tinfo *TransferInfo)

sipID, err = pipeline.TransferStatus(ctx, amc, tinfo.TransferID)
if errors.Is(err, pipeline.ErrStatusNonRetryable) {
return backoff.Permanent(err)
return backoff.Permanent(nonRetryableError(err))
}

return err
Expand Down

0 comments on commit 6f8e9af

Please sign in to comment.