diff --git a/conf.d/pgsqldb.conf.sample b/conf.d/pgsqldb.conf.sample index 33451935..bb3570a7 100644 --- a/conf.d/pgsqldb.conf.sample +++ b/conf.d/pgsqldb.conf.sample @@ -10,6 +10,9 @@ ;[default] ; The section name is used as the database connection name +; autostart: bool: Automatically initiate the connection on startup +;autostart=yes + ; timeout: int: Query timeout in milliseconds ;timeout=10000 diff --git a/modules/server/pgsqldb.cpp b/modules/server/pgsqldb.cpp index ced5817f..632b94db 100644 --- a/modules/server/pgsqldb.cpp +++ b/modules/server/pgsqldb.cpp @@ -392,7 +392,8 @@ void PgModule::initialize() if (!sec || (*sec == "general")) continue; PgConn* conn = new PgConn(sec); - conn->initDb(); + if (sec->getBoolValue("autostart",true)) + conn->initDb(); s_conns.insert(conn); }