From 4b89ede756820004b5bae7d3a2b4a956bf2f085a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Mon, 15 Jan 2024 14:46:39 +0100 Subject: [PATCH] Do not error-log when outdated resources can't be indexed anymore That's an expected, totally valid case --- services/search/pkg/search/search.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/services/search/pkg/search/search.go b/services/search/pkg/search/search.go index 77eb5b741b6..6bce856ea08 100644 --- a/services/search/pkg/search/search.go +++ b/services/search/pkg/search/search.go @@ -88,13 +88,17 @@ func statResource(ctx context.Context, ref *provider.Reference, gatewaySelector logger.Error().Err(err).Msg("failed to stat the moved resource") return nil, err } - if res.Status.Code != rpc.Code_CODE_OK { + switch res.Status.Code { + case rpc.Code_CODE_OK: + return res, nil + case rpc.Code_CODE_NOT_FOUND: + // Resource was moved or deleted in the meantime. ignore. + return nil, err + default: err := errors.New("failed to stat the moved resource") logger.Error().Interface("res", res).Msg(err.Error()) return nil, err } - - return res, nil } // NOTE: this converts CS3 to WebDAV permissions