diff --git a/services/postprocessing/README.md b/services/postprocessing/README.md index dd13d92d5..c8cd1182f 100644 --- a/services/postprocessing/README.md +++ b/services/postprocessing/README.md @@ -60,3 +60,19 @@ When setting a custom postprocessing step (eg. `"customstep"`) the postprocessin Once the custom service has finished its work, it should sent an event of type `PostprocessingFinished` via the configured events system. This event needs to contain a `FinishedStep` field set to `"customstep"`. It also must contain the outcome of the step, which can be one of "delete" (abort postprocessing, delete the file), "abort" (abort postprocessing, keep the file) and "continue" (continue postprocessing, this is the success case). See the [cs3 org](https://github.com/cs3org/reva/blob/edge/pkg/events/postprocessing.go) for up-to-date information of reserved step names and event definitions. + +## CLI Commands + +### Resume Postprocessing + +If postprocessing fails in one step due to an unforseen error, current uploads will not be retried automatically. A system admin can instead run a CLI command to retry the failed upload which is a two step process: + +- First find the upload ID of the failed upload. +```bash +ocis storage-users uploads list +``` + +- Then use the restart command to resume postprocessing of the ID selected. +```bash +ocis postprocessing restart -u +``` diff --git a/services/postprocessing/pkg/command/postprocessing.go b/services/postprocessing/pkg/command/postprocessing.go index b49d4b9ef..999727f8c 100644 --- a/services/postprocessing/pkg/command/postprocessing.go +++ b/services/postprocessing/pkg/command/postprocessing.go @@ -1,7 +1,6 @@ package command import ( - "fmt" "time" "github.com/cs3org/reva/v2/pkg/events" @@ -40,7 +39,6 @@ func RestartPostprocessing(cfg *config.Config) *cli.Command { } if err := events.Publish(stream, ev); err != nil { - fmt.Println(err) return err } diff --git a/services/postprocessing/pkg/service/service.go b/services/postprocessing/pkg/service/service.go index b68f06e7c..3e2afc077 100644 --- a/services/postprocessing/pkg/service/service.go +++ b/services/postprocessing/pkg/service/service.go @@ -56,11 +56,6 @@ func (pps *PostprocessingService) Run() error { switch ev := e.Event.(type) { case events.BytesReceived: pp = postprocessing.New(ev.UploadID, ev.URL, ev.ExecutingUser, ev.Filename, ev.Filesize, ev.ResourceID, pps.steps, pps.c.Delayprocessing) - if err := storePP(pps.store, pp); err != nil { - pps.log.Error().Str("uploadID", ev.UploadID).Err(err).Msg("cannot store upload") - continue - } - next = pp.Init(ev) case events.PostprocessingStepFinished: if ev.UploadID == "" { @@ -101,7 +96,7 @@ func (pps *PostprocessingService) Run() error { if pp != nil { if err := storePP(pps.store, pp); err != nil { pps.log.Error().Str("uploadID", pp.ID).Err(err).Msg("cannot store upload") - // TODO: should we continue here? + continue // TODO: should we really continue here? } } if next != nil {