Skip to content

Commit

Permalink
clean up logs of empty op key
Browse files Browse the repository at this point in the history
Signed-off-by: shaoting-huang <[email protected]>
  • Loading branch information
shaoting-huang committed Jan 16, 2025
1 parent 75d7978 commit e4eaaa7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions internal/rootcoord/rbac_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Check warning on line 219 in internal/rootcoord/rbac_task.go

View check run for this annotation

Codecov / codecov/patch

internal/rootcoord/rbac_task.go#L217-L219

Added lines #L217 - L219 were not covered by tests
}
return nil, nil
}))
Expand Down

0 comments on commit e4eaaa7

Please sign in to comment.