Increase context timeout for bandwidth throttled reader (#12820)

increase default timeout up to one hour for toy setups.

fixes #12812
This commit is contained in:
Poorna Krishnamoorthy
2021-07-28 15:20:01 -07:00
committed by GitHub
parent bfbdb8f0a8
commit b6cd54779c
4 changed files with 24 additions and 3 deletions

View File

@@ -179,3 +179,11 @@ func (m *Monitor) SetBandwidthLimit(bucket string, limit int64) {
t.Limiter = rate.NewLimiter(newlimit, int(t.NodeBandwidthPerSec))
m.bucketThrottle[bucket] = t
}
// IsThrottled returns true if a bucket has bandwidth throttling enabled.
func (m *Monitor) IsThrottled(bucket string) bool {
m.tlock.RLock()
defer m.tlock.RUnlock()
_, ok := m.bucketThrottle[bucket]
return ok
}