comparison Framework/PostgreSQL/PostgreSQLParameters.cpp @ 141:0b3e9ee53c46

Added 'MaximumConnectionRetries' & 'ConnectionRetryInterval' to configure the retries when connecting to the DB at startup
author Alain Mazy <alain@mazy.be>
date Mon, 03 Feb 2020 22:29:51 +0100
parents 4cd7e45b671e
children 063aa53b5917
comparison
equal deleted inserted replaced
140:4cd7e45b671e 141:0b3e9ee53c46
37 password_ = ""; 37 password_ = "";
38 database_.clear(); 38 database_.clear();
39 uri_.clear(); 39 uri_.clear();
40 ssl_ = false; 40 ssl_ = false;
41 lock_ = true; 41 lock_ = true;
42 maxConnectionRetries_ = 10;
43 connectionRetryInterval_ = 5;
42 } 44 }
43 45
44 46
45 PostgreSQLParameters::PostgreSQLParameters() 47 PostgreSQLParameters::PostgreSQLParameters()
46 { 48 {
88 90
89 ssl_ = configuration.GetBooleanValue("EnableSsl", false); 91 ssl_ = configuration.GetBooleanValue("EnableSsl", false);
90 } 92 }
91 93
92 lock_ = configuration.GetBooleanValue("Lock", true); // Use locking by default 94 lock_ = configuration.GetBooleanValue("Lock", true); // Use locking by default
95
96 maxConnectionRetries_ = configuration.GetUnsignedIntegerValue("MaximumConnectionRetries", 10);
97 connectionRetryInterval_ = configuration.GetUnsignedIntegerValue("ConnectionRetryInterval", 5);
93 } 98 }
94 99
95 100
96 void PostgreSQLParameters::SetConnectionUri(const std::string& uri) 101 void PostgreSQLParameters::SetConnectionUri(const std::string& uri)
97 { 102 {