diff --git a/services/antivirus/pkg/service/service.go b/services/antivirus/pkg/service/service.go index a56793c18..961273802 100644 --- a/services/antivirus/pkg/service/service.go +++ b/services/antivirus/pkg/service/service.go @@ -108,9 +108,14 @@ func (av Antivirus) Run() error { errmsg = err.Error() } - outcome := events.PPOutcomeContinue - if res.Infected { + var outcome events.PostprocessingOutcome + switch { + case res.Infected: outcome = av.o + case !res.Infected && err == nil: + outcome = events.PPOutcomeContinue + default: + outcome = events.PPOutcomeAbort } av.l.Info().Str("uploadid", ev.UploadID).Interface("resourceID", ev.ResourceID).Str("virus", res.Description).Str("outcome", string(outcome)).Str("filename", ev.Filename).Str("user", ev.ExecutingUser.GetId().GetOpaqueId()).Bool("infected", res.Infected).Msg("File scanned")