diff --git a/changelog/unreleased/restart-postprocessing.md b/changelog/unreleased/restart-postprocessing.md new file mode 100644 index 00000000000..73850899879 --- /dev/null +++ b/changelog/unreleased/restart-postprocessing.md @@ -0,0 +1,6 @@ +Bugfix: Restart Postprocessing + +In case the postprocessing service cannot find the specified upload when restarting postprocessing, it will now send a +`RestartPostprocessing` event to retrigger complete postprocessing + +https://github.com/owncloud/ocis/pull/6726 diff --git a/services/postprocessing/pkg/service/service.go b/services/postprocessing/pkg/service/service.go index 3e2afc077b0..ab2101dcb51 100644 --- a/services/postprocessing/pkg/service/service.go +++ b/services/postprocessing/pkg/service/service.go @@ -87,6 +87,15 @@ func (pps *PostprocessingService) Run() error { case events.ResumePostprocessing: pp, err = getPP(pps.store, ev.UploadID) if err != nil { + if err == store.ErrNotFound { + if err := events.Publish(pps.pub, events.RestartPostprocessing{ + UploadID: ev.UploadID, + Timestamp: ev.Timestamp, + }); err != nil { + pps.log.Error().Str("uploadID", ev.UploadID).Err(err).Msg("cannot publish RestartPostprocessing event") + } + continue + } pps.log.Error().Str("uploadID", ev.UploadID).Err(err).Msg("cannot get upload") continue }