improve readme

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2023-06-12 15:27:25 +02:00
parent aac793a400
commit f23f35e227
3 changed files with 17 additions and 8 deletions

View File

@@ -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 <uploadID>
```

View File

@@ -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
}

View File

@@ -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 {