Skip to content

Commit

Permalink
Add redis DB option
Browse files Browse the repository at this point in the history
  • Loading branch information
paulyhedral committed Oct 26, 2024
1 parent 7ccd48e commit 831a4a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/catalog-api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 831a4a6

Please sign in to comment.