Skip to content

Commit 57b63f4

Browse files
committed
pipeline: work around am#690 (missing SIPID)
1 parent b49e623 commit 57b63f4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

internal/pipeline/status.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ func TransferStatus(ctx context.Context, client *amclient.Client, ID string) (st
2929
}
3030

3131
switch {
32+
33+
// State that we can't handle.
3234
default:
3335
fallthrough
3436
case status.Status == "COMPLETE" && status.SIPID == "BACKLOG":
@@ -39,10 +41,20 @@ func TransferStatus(ctx context.Context, client *amclient.Client, ID string) (st
3941
fallthrough
4042
case status.Status == "FAILED" || status.Status == "REJECTED":
4143
return "", fmt.Errorf("error checking transfer status (%w): transfer is in a state that we can't handle: %s", ErrStatusNonRetryable, status.Status)
44+
45+
// Processing state where we want to keep waiting.
46+
case status.Status == "COMPLETE" && status.SIPID == "":
47+
// It is possible (due to https://github.com/archivematica/Issues/issues/690),
48+
// that AM tells us that the transfer completed but the SIPID field is
49+
// not populated.
50+
fallthrough
4251
case status.Status == "PROCESSING":
4352
return "", ErrStatusInProgress
53+
54+
// Success!
4455
case status.Status == "COMPLETE":
4556
return status.SIPID, nil
57+
4658
}
4759
}
4860

0 commit comments

Comments
 (0)