fixup! fixup! ...

This commit is contained in:
2023-04-08 06:20:11 +01:00
parent 8e26d79df7
commit 7623410bfe
3 changed files with 19 additions and 18 deletions
+4 -1
View File
@@ -2,6 +2,7 @@ package gql
import (
"crypto/tls"
"fmt"
"time"
"github.com/allegro/bigcache"
@@ -103,11 +104,13 @@ func (b *BaseClient) enableCache() {
var err error
b.cache.client, err = bigcache.NewBigCache(bigcache.DefaultConfig(time.Duration(b.cache.ttl) * time.Second))
if err != nil {
b.Logger.Error(b, "Error while creating cache client;", "error", err.Error())
fmt.Println(">> Error while creating cache client;", "error", err.Error())
panic(err)
}
}
func (b *BaseClient) disableCache() {
b.Logger.Debug(b, "Disabling cache")
b.cache.enabled = false
b.cache.client = nil
}