From 0622a2379f30bbac3224cd843a8d5236bc0c60e4 Mon Sep 17 00:00:00 2001 From: paulc Date: Tue, 5 Jan 2010 12:39:34 +0000 Subject: [PATCH] Setting to disable autostart of connections to Postgres servers. git-svn-id: http://voip.null.ro/svn/yate@3005 acf43c95-373e-0410-b603-e72c3f656dc1 --- conf.d/pgsqldb.conf.sample | 3 +++ modules/server/pgsqldb.cpp | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) 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); }