limits.Agent.enforce needs to consider the store.Account.Limitless flag

This commit is contained in:
Michael Quigley 2023-06-07 11:00:42 -04:00
parent 04fddce422
commit edef86d06a
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
2 changed files with 9 additions and 1 deletions

View File

@ -239,6 +239,14 @@ func (a *Agent) enforce(u *metrics.Usage) error {
}
defer func() { _ = trx.Rollback() }()
acct, err := a.str.GetAccount(int(u.AccountId), trx)
if err != nil {
return err
}
if acct.Limitless {
return nil
}
if enforce, warning, rxBytes, txBytes, err := a.checkAccountLimit(u.AccountId); err == nil {
if enforce {
enforced := false

View File

@ -451,4 +451,4 @@ You use the `zrok reserve` command to create _reserved shares_. Reserved shares
Interested in self-hosting your own `zrok` service instance? See the [self-hosting guide](./guides/self-hosting/self_hosting_guide.md) for details.
[openziti]: https://docs.openziti.io/docs/learn/introduction/ "OpenZiti"
[ zrok-download]: https://zrok.io "Zrok Download"
[ zrok-download]: https://zrok.io "zrok Download"