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
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