From c93cc8270ffe11945a00171de09a4664d85b4c33 Mon Sep 17 00:00:00 2001 From: Mohammed Sohail Date: Mon, 4 Nov 2024 08:34:05 +0300 Subject: [PATCH] fix: remove required redis configs --- cmd/service/main.go | 9 ++++++--- dev/docker-compose.yaml | 13 ------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/cmd/service/main.go b/cmd/service/main.go index df4248f..4824be0 100644 --- a/cmd/service/main.go +++ b/cmd/service/main.go @@ -79,15 +79,18 @@ func main() { os.Exit(1) } - cache, err := cache.New(cache.CacheOpts{ + cacheOpts := cache.CacheOpts{ Chain: chain, Registries: ko.Strings("bootstrap.ge_registries"), Watchlist: ko.Strings("bootstrap.watchlist"), Blacklist: ko.Strings("bootstrap.blacklist"), CacheType: ko.MustString("core.cache_type"), - RedisDSN: ko.MustString("redis.dsn"), Logg: lo, - }) + } + if ko.MustString("core.cache_type") == "redis" { + cacheOpts.RedisDSN = ko.MustString("redis.dsn") + } + cache, err := cache.New(cacheOpts) if err != nil { lo.Error("could not initialize cache", "error", err) os.Exit(1) diff --git a/dev/docker-compose.yaml b/dev/docker-compose.yaml index 29054e9..b5668c6 100644 --- a/dev/docker-compose.yaml +++ b/dev/docker-compose.yaml @@ -1,17 +1,4 @@ services: - redis: - image: redis:7-alpine - restart: unless-stopped - command: redis-server --save 60 1 --loglevel warning - volumes: - - tracker-redis:/data - ports: - - "127.0.0.1:6379:6379" - healthcheck: - test: ["CMD-SHELL", "redis-cli ping | grep PONG"] - interval: 10s - timeout: 5s - retries: 5 nats: image: nats:2 restart: unless-stopped