From 8d9bdfd6e07d9acac50cae53de8d32436873e7f0 Mon Sep 17 00:00:00 2001 From: neil-pozetroninc Date: Sun, 20 May 2018 01:29:42 -0700 Subject: [PATCH] BUGFIX: RethinkDB backend connection Updating the RethinkDB backend to check if a connection exists before creating one. --- kaneda/backends/rethink.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kaneda/backends/rethink.py b/kaneda/backends/rethink.py index 703d488..56e376b 100644 --- a/kaneda/backends/rethink.py +++ b/kaneda/backends/rethink.py @@ -39,6 +39,8 @@ def __init__(self, db, table_name=None, connection=None, host=None, port=None, u self.connection = r.connect(host=host, port=port, db=db, timeout=timeout) self.db = db self.table_name = table_name + if self.connection is None: + self.connection = r.connect(db=db, timeout=timeout) self._create_database() def _get_payload(self, name, value, tags, id_):