summaryrefslogtreecommitdiff
path: root/controller/RethinkDB.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'controller/RethinkDB.cpp')
-rw-r--r--controller/RethinkDB.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/controller/RethinkDB.cpp b/controller/RethinkDB.cpp
index f6c8a59c..a46d033f 100644
--- a/controller/RethinkDB.cpp
+++ b/controller/RethinkDB.cpp
@@ -263,9 +263,13 @@ RethinkDB::RethinkDB(EmbeddedNetworkController *const nc,const Identity &myId,co
std::unique_ptr<R::Connection> rdb;
while (_run == 1) {
try {
- if (!rdb)
+ if (!rdb) {
+ _connected = 0;
rdb = R::connect(this->_host,this->_port,this->_auth);
+ }
+
if (rdb) {
+ _connected = 1;
R::Array batch;
R::Object tmpobj;
@@ -434,6 +438,11 @@ bool RethinkDB::waitForReady()
return true;
}
+bool RethinkDB::isReady()
+{
+ return ((_ready)&&(_connected));
+}
+
void RethinkDB::save(nlohmann::json *orig,nlohmann::json &record)
{
if (!record.is_object()) // sanity check