chore: require at least one database connection

This commit is contained in:
Ferdinand Mütsch 2021-02-02 22:52:13 +01:00
parent 1dc5be4784
commit a7afd73e62
1 changed files with 5 additions and 1 deletions

View File

@ -21,7 +21,7 @@ import (
)
const (
defaultConfigPath = "config.yml"
defaultConfigPath = "config.yml"
SQLDialectMysql = "mysql"
SQLDialectPostgres = "postgres"
@ -312,6 +312,10 @@ func Load() *Config {
logbuch.Fatal("either of listen_ipv4 or listen_ipv6 must be set")
}
if config.Db.MaxConn <= 0 {
logbuch.Fatal("you must allow at least one database connection")
}
Set(config)
return Get()
}