From 831a4a67c64bcceda3fba065c80508f45a294053 Mon Sep 17 00:00:00 2001 From: Paul Schifferer Date: Sat, 26 Oct 2024 11:45:25 -0700 Subject: [PATCH] Add redis DB option --- cmd/catalog-api/main.go | 1 + constants/constants.go | 1 + 2 files changed, 2 insertions(+) diff --git a/cmd/catalog-api/main.go b/cmd/catalog-api/main.go index f9f457e..5bdcc3a 100644 --- a/cmd/catalog-api/main.go +++ b/cmd/catalog-api/main.go @@ -54,6 +54,7 @@ func main() { redisHost, found := os.LookupEnv(constants.REDIS_HOST) if found { redisPort := util.GetEnv(constants.REDIS_PORT, "6379") + // TODO: redisDb := util.GetEnv(constants.REDIS_DB, "0") cache = persistence.NewRedisCache(fmt.Sprintf("%s:%s", redisHost, redisPort), constants.REDIS_PASS, time.Hour) } else { cache = persistence.NewInMemoryStore(time.Hour) diff --git a/constants/constants.go b/constants/constants.go index 971bedd..555a279 100644 --- a/constants/constants.go +++ b/constants/constants.go @@ -14,6 +14,7 @@ const ( ERROR = "ERROR" INFO = "INFO" LOG_LEVEL = "LOG_LEVEL" + REDIS_DB = "REDIS_DB" REDIS_HOST = "REDIS_HOST" REDIS_PASS = "REDIS_PASS" REDIS_PORT = "REDIS_PORT"