From edc53a80d4202673525dc7662b4cf91fa9798f95 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Wed, 5 Jul 2023 13:42:14 +0200 Subject: [PATCH] restart complete pp when pp cannot be found Signed-off-by: jkoberg --- changelog/unreleased/restart-postprocessing.md | 6 ++++++ services/postprocessing/pkg/service/service.go | 9 +++++++++ 2 files changed, 15 insertions(+) create mode 100644 changelog/unreleased/restart-postprocessing.md 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 }