[glom] Postgres::attempt_connect(): Specify a timeout.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Postgres::attempt_connect(): Specify a timeout.
- Date: Tue, 15 Dec 2015 09:03:51 +0000 (UTC)
commit b1cef77fac25b1e405dc796c895dd89bf33ed4fb
Author: Murray Cumming <murrayc murrayc com>
Date: Tue Dec 15 09:04:22 2015 +0100
Postgres::attempt_connect(): Specify a timeout.
Via the CONNECT_TIMEOUT paramater for libgda's cnc_string,
as listed by this command-line command:
gda-sql-5.0 -L PostgreSQL
glom/libglom/connectionpool_backends/postgres.cc | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/glom/libglom/connectionpool_backends/postgres.cc
b/glom/libglom/connectionpool_backends/postgres.cc
index bf0b1b7..3b03d48 100644
--- a/glom/libglom/connectionpool_backends/postgres.cc
+++ b/glom/libglom/connectionpool_backends/postgres.cc
@@ -73,7 +73,8 @@ Glib::RefPtr<Gnome::Gda::Connection> Postgres::attempt_connect(const Glib::ustri
const auto default_database = "template1";
//const auto actual_database = (!database.empty()) ? database : default_database;;
const auto cnc_string_main = "HOST=" + DbUtils::gda_cnc_string_encode(m_host)
- + ";PORT=" + DbUtils::gda_cnc_string_encode(port);
+ + ";PORT=" + DbUtils::gda_cnc_string_encode(port)
+ + ";CONNECT_TIMEOUT=10"; //10 seconds timeout, instead of indefinite.
const auto cnc_string = cnc_string_main + ";DB_NAME=" + DbUtils::gda_cnc_string_encode(database);
Glib::RefPtr<Gnome::Gda::Connection> connection;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]