From a7afd73e62d23be5e7ec0761374d3328aad5a50a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferdinand=20M=C3=BCtsch?= Date: Tue, 2 Feb 2021 22:52:13 +0100 Subject: [PATCH] chore: require at least one database connection --- config/config.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index 36ab942..16f8ca9 100644 --- a/config/config.go +++ b/config/config.go @@ -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() }