Skip to content

Commit

Permalink
Merge pull request #4384 from aduffeck/retry-pp
Browse files Browse the repository at this point in the history
Add outcome and event for retrying postprocessing steps
  • Loading branch information
aduffeck authored Dec 12, 2023
2 parents 41aa50b + daac09a commit ab6ed78
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/add-retry-pp-outcome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Add a retry postprocessing outcome and event

We added a retry postprocessing outcome and event. This enhancement provides the ability to handle retry scenarios during postprocessing.

https://github.com/cs3org/reva/pull/4384
18 changes: 18 additions & 0 deletions pkg/events/postprocessing.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ var (
PPOutcomeAbort PostprocessingOutcome = "abort"
// PPOutcomeContinue means that the upload is moved to its final destination (eventually being marked with pp results)
PPOutcomeContinue PostprocessingOutcome = "continue"
// PPOutcomeRetry means that there was a temporary issue and the postprocessing should be retried at a later point in time
PPOutcomeRetry PostprocessingOutcome = "retry"
)

// BytesReceived is emitted by the server when it received all bytes of an upload
Expand Down Expand Up @@ -153,6 +155,22 @@ func (PostprocessingFinished) Unmarshal(v []byte) (interface{}, error) {
return e, err
}

// PostprocessingRetry is emitted by *some* service which can decide that
type PostprocessingRetry struct {
UploadID string
Filename string
ExecutingUser *user.User
Failures int
BackoffDuration time.Duration
}

// Unmarshal to fulfill umarshaller interface
func (PostprocessingRetry) Unmarshal(v []byte) (interface{}, error) {
e := PostprocessingRetry{}
err := json.Unmarshal(v, &e)
return e, err
}

// UploadReady is emitted by the storage provider when postprocessing is finished
type UploadReady struct {
UploadID string
Expand Down

0 comments on commit ab6ed78

Please sign in to comment.