summaryrefslogtreecommitdiff
path: root/controller/PostgreSQL.hpp
diff options
context:
space:
mode:
authorGrant Limberg <[email protected]>2018-12-03 15:19:15 -0800
committerGrant Limberg <[email protected]>2018-12-03 15:19:15 -0800
commitc8d5215870a6361a080b3fcf82f7a1707ae20bb5 (patch)
tree35ad739f5ae555913e75665f4002e783e044f15c /controller/PostgreSQL.hpp
parent62ccb48a0ba20ad244acbf4859fe6b4a19335619 (diff)
add handling for PGBOUNCER_CONNSTR environment variable.
alows Central controllers to connect to PGBouncer on some threads. LISTEN threads still require a direct connection to the DB
Diffstat (limited to 'controller/PostgreSQL.hpp')
-rw-r--r--controller/PostgreSQL.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/controller/PostgreSQL.hpp b/controller/PostgreSQL.hpp
index 36fe8c9f..6f127d5a 100644
--- a/controller/PostgreSQL.hpp
+++ b/controller/PostgreSQL.hpp
@@ -64,6 +64,13 @@ private:
void commitThread();
void onlineNotificationThread();
+ enum OverrideMode {
+ ALLOW_PGBOUNCER_OVERRIDE = 0,
+ NO_OVERRIDE = 1
+ };
+
+ PGconn * getPgConn( OverrideMode m = ALLOW_PGBOUNCER_OVERRIDE );
+
std::string _connString;
BlockingQueue<nlohmann::json *> _commitQueue;