Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If rules hasn't changed, I hope don't rebuild tree. #6

Open
520MianXiangDuiXiang520 opened this issue Sep 18, 2022 · 0 comments
Open

Comments

@520MianXiangDuiXiang520

grbac/grbac.go

Line 157 in a046173

rules, err := c.loader()

Rule does not change often, and it may be a waste to rebuild the tree every time you execute runCronTab, so I hope loader can tell Controller to stop reload, like

func (c *Controller) reload() error {
    if c.loader == nil {
        return ErrUndefinedLoader
    }

    rules, err := c.loader()
    if err != nil {
        if errors.Is(err, ErrRulesNoChanged) {
            return nil
        }
        return err
    }
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant