Use default value for redis-host if value is empty

This commit is contained in:
2xsaiko 2020-07-06 15:49:11 +02:00 committed by Drew DeVault
parent 04342b3a01
commit 1bbbc0beda
1 changed files with 2 additions and 2 deletions

View File

@ -51,8 +51,8 @@ func main() {
logger.Fatalf("Failed to load config file: %v", err)
}
redisHost, ok := config.Get("sr.ht", "redis-host")
if !ok {
redisHost, _ := config.Get("sr.ht", "redis-host")
if redisHost == "" {
redisHost = "redis://localhost:6379"
}
ropts, err := goredis.ParseURL(redisHost)