From fb7b07fc42104b8eb4d38cca109406edc4a185cd Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 3 Apr 2025 14:48:13 -0700 Subject: [PATCH] make sure the pg connstring is correct for cv2:// instances --- controller/CV2.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/controller/CV2.cpp b/controller/CV2.cpp index 364378b7b..fc72d6d42 100644 --- a/controller/CV2.cpp +++ b/controller/CV2.cpp @@ -49,7 +49,14 @@ CV2::CV2(const Identity &myId, const char *path, int listenPort) { char myAddress[64]; _myAddressStr = myId.address().toString(myAddress); - _connString = std::string(path); + + // replace cv2: with postgres: for the path/connstring + std::string _path(path); + if (_path.length() > 4 && _path.substr(0, 4) == "cv2:") { + _path = "postgres:" + _path.substr(4); + } + _connString = std::string(_path); + auto f = std::make_shared(_connString); _pool = std::make_shared >( 15, 5, std::static_pointer_cast(f));