remove noise debug with cache hit/miss info

This commit is contained in:
Umputun
2018-05-16 14:29:07 -05:00
parent 88d91f857e
commit 7e6a15a0f4
-3
View File
@@ -1,7 +1,6 @@
package rest
import (
"log"
"net/http"
"strings"
"time"
@@ -29,11 +28,9 @@ func NewLoadingCache(defaultExpiration, cleanupInterval time.Duration, postFlush
// Get is loading cache method to get value by key or load via fn if not found
func (lc *loadingCache) Get(key string, ttl time.Duration, fn func() ([]byte, error)) (data []byte, err error) {
if b, ok := lc.bytesCache.Get(key); ok {
log.Printf("[DEBUG] cache hit %s", key)
return b.([]byte), nil
}
log.Printf("[DEBUG] cache miss %s", key)
if data, err = fn(); err != nil {
return data, err
}