Add self-sufficient cache and abandon outdated library.

This commit is contained in:
2023-10-13 20:35:20 +01:00
parent 1df2ae5d16
commit ca13be5ef6
5 changed files with 23 additions and 27 deletions
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"fmt"
"time"
"github.com/akyoto/cache"
"github.com/lukaszraczylo/go-simple-graphql/utils/logger"
libpack_cache "github.com/lukaszraczylo/graphql-monitoring-proxy/cache"
"golang.org/x/net/http2"
@@ -111,7 +111,7 @@ func (b *BaseClient) SetOutput(output string) {
func (b *BaseClient) enableCache() {
var err error
b.cache.client = cache.New(time.Duration(b.cache.ttl) * time.Second * 2)
b.cache.client = libpack_cache.New(time.Duration(b.cache.ttl) * time.Second * 2)
if err != nil {
fmt.Println(">> Error while creating cache client;", "error", err.Error())
panic(err)