add redis cache to competitions
This commit is contained in:
@@ -21,6 +21,10 @@ type Config struct {
|
||||
DBPassword string
|
||||
DBName string
|
||||
JWTSecret string
|
||||
RedisAddr string
|
||||
RedisPassword string
|
||||
RedisDB int
|
||||
CacheEnabled bool
|
||||
}
|
||||
|
||||
func Load() (*Config, error) {
|
||||
@@ -37,6 +41,10 @@ func Load() (*Config, error) {
|
||||
DBPassword: getEnv("POSTGRES_PASSWORD", "postgres"),
|
||||
DBName: getEnv("POSTGRES_DATABASE", "postgres"),
|
||||
JWTSecret: getEnv("JWT_SECRET", "your-secret-key-change-in-production"),
|
||||
RedisAddr: getEnv("REDIS_ADDR", "localhost:6379"),
|
||||
RedisPassword: getEnv("REDIS_PASSWORD", ""),
|
||||
RedisDB: mustGetInt("REDIS_DB", 0),
|
||||
CacheEnabled: mustGetBool("CACHE_ENABLED", true),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user