From 5b240c590e9c34a740afd6bbf535dcd5395176be Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Sun, 20 Nov 2022 17:54:42 +0100 Subject: [PATCH] Print PREFETCH only when prefetching --- cmd/peakHandling.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/peakHandling.go b/cmd/peakHandling.go index eb98191..d279564 100644 --- a/cmd/peakHandling.go +++ b/cmd/peakHandling.go @@ -55,10 +55,10 @@ func syncMapLen(sm *sync.Map) int { func prefetchPeakRequests(peakRequestMap *sync.Map) { peakRequestLen := syncMapLen(peakRequestMap) - log.Printf("PREFETCH: Prefetching %d requests\n", peakRequestLen) if peakRequestLen == 0 { return } + log.Printf("PREFETCH: Prefetching %d requests\n", peakRequestLen) sleepBetweenRequests := time.Duration(prefetchInterval*1000/peakRequestLen) * time.Millisecond peakRequestMap.Range(func(key interface{}, value interface{}) bool { go func(r http.Request) {