diff --git a/adaptive.go b/adaptive.go index 772021e..df76a79 100644 --- a/adaptive.go +++ b/adaptive.go @@ -107,7 +107,7 @@ func (a *adaptive) Target(s Stats) (int, time.Duration) { // magic number 2: we allow max 2 idle items to be collected only by the nightshift, to provide better // support for sporadic requests, when it's active or just going inactive: - if t < 2 && a.activeStart.After(a.activeEnd) { + if t < 2 && (!a.initialized || a.activeStart.After(a.activeEnd)) { t = 2 }