mirror of
https://github.com/openziti/zrok.git
synced 2024-11-07 08:44:14 +01:00
ignore scoped backends when unscoped limit class in limit action (#606)
This commit is contained in:
parent
aee973379c
commit
efd16c2760
@ -32,6 +32,7 @@ func (a *limitAction) HandleAccount(acct *store.Account, _, _ int64, bwc store.B
|
||||
}
|
||||
|
||||
ignoreBackends := ul.ignoreBackends(bwc)
|
||||
logrus.Warnf("ignore backends excluding '%v': %v", bwc, ignoreBackends)
|
||||
for _, env := range envs {
|
||||
shrs, err := a.str.FindSharesForEnvironment(env.Id, trx)
|
||||
if err != nil {
|
||||
|
@ -35,6 +35,12 @@ func (ul *userLimits) ignoreBackends(bwc store.BandwidthClass) map[sdk.BackendMo
|
||||
}
|
||||
}
|
||||
return ignoreBackends
|
||||
} else {
|
||||
ignoreBackends := make(map[sdk.BackendMode]bool)
|
||||
for backendMode := range ul.scopes {
|
||||
ignoreBackends[backendMode] = true
|
||||
}
|
||||
return ignoreBackends
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user