Add distibuted cache with Redis

This commit is contained in:
2024-06-11 11:35:50 +01:00
parent a01a4da9b5
commit 12e0294945
15 changed files with 407 additions and 89 deletions
+6
View File
@@ -3,9 +3,11 @@ package main
import (
"os"
"testing"
"time"
"github.com/goccy/go-json"
"github.com/gofiber/fiber/v2"
libpack_cache "github.com/lukaszraczylo/graphql-monitoring-proxy/cache/memory"
libpack_logging "github.com/lukaszraczylo/graphql-monitoring-proxy/logging"
assertions "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
@@ -32,6 +34,10 @@ func (suite *Tests) SetupTest() {
JSONDecoder: json.Unmarshal,
},
)
cacheStats = &CacheStats{}
// Initialize a simple in-memory cache client for testing purposes
cfg.Cache.Client = libpack_cache.New(5 * time.Minute)
parseConfig()
enableApi()
StartMonitoringServer()