From 595112b9cf98e3e0ec7362f1b871b7e462f3a58c Mon Sep 17 00:00:00 2001 From: Bagas Aulia Rezki Date: Sun, 8 Sep 2024 17:25:02 +0700 Subject: [PATCH] Add Redis initialization to main function --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index addb202..1ed4f6e 100644 --- a/main.go +++ b/main.go @@ -24,9 +24,12 @@ func main() { dbHost := utils.Getenv("DB_HOST") dbPort := utils.Getenv("DB_PORT") dbName := utils.Getenv("DB_NAME") + redisHost := utils.Getenv("REDIS_HOST") + redisPort := utils.Getenv("REDIS_PORT") + redisPassword := utils.Getenv("REDIS_PASSWORD") database := db.NewPostgresDB(dbUser, dbPass, dbHost, dbPort, dbName, db.DisableSSL) - cacheServer := cache.NewRedisServer(database) + cacheServer := cache.NewRedisServer(redisHost, redisPort, redisPassword, database) services := service.NewService(database, cacheServer) smtpPort, _ := strconv.Atoi(utils.Getenv("SMTP_PORT"))