mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
chore: require at least one database connection
This commit is contained in:
parent
1dc5be4784
commit
a7afd73e62
@ -21,7 +21,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
defaultConfigPath = "config.yml"
|
defaultConfigPath = "config.yml"
|
||||||
|
|
||||||
SQLDialectMysql = "mysql"
|
SQLDialectMysql = "mysql"
|
||||||
SQLDialectPostgres = "postgres"
|
SQLDialectPostgres = "postgres"
|
||||||
@ -312,6 +312,10 @@ func Load() *Config {
|
|||||||
logbuch.Fatal("either of listen_ipv4 or listen_ipv6 must be set")
|
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)
|
Set(config)
|
||||||
return Get()
|
return Get()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user