Skip to content

Commit

Permalink
Merge pull request #8200 from aduffeck/improve-search-logging
Browse files Browse the repository at this point in the history
Do not error-log when outdated resources can't be indexed anymore
  • Loading branch information
aduffeck authored Jan 16, 2024
2 parents 3cc485a + 4b89ede commit dfd022e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions services/search/pkg/search/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dfd022e

Please sign in to comment.