enhance: clean up logs of empty op key (#39335)

related: https://github.com/milvus-io/milvus/issues/39334

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
pull/38981/head
sthuang 2025-01-17 10:29:03 +08:00 committed by GitHub
parent 4c76f0403f
commit 3c9f26942d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 6 deletions

View File

@ -209,12 +209,14 @@ func executeOperatePrivilegeTaskSteps(ctx context.Context, core *Core, in *milvu
})
})
}
if err := core.proxyClientManager.RefreshPolicyInfoCache(ctx, &proxypb.RefreshPolicyInfoCacheRequest{
OpType: opType,
OpKey: funcutil.PolicyForPrivileges(expandGrants),
}); err != nil {
log.Ctx(ctx).Warn("fail to refresh policy info cache", zap.Any("in", in), zap.Error(err))
return nil, err
if len(expandGrants) > 0 {
if err := core.proxyClientManager.RefreshPolicyInfoCache(ctx, &proxypb.RefreshPolicyInfoCacheRequest{
OpType: opType,
OpKey: funcutil.PolicyForPrivileges(expandGrants),
}); err != nil {
log.Ctx(ctx).Warn("fail to refresh policy info cache", zap.Any("in", in), zap.Error(err))
return nil, err
}
}
return nil, nil
}))