From fc791e03d452e7907cf45744f928148de707cf80 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Sun, 27 Oct 2019 01:08:12 -0700 Subject: [PATCH] DBManager: Don't test connection on start This gives the individual services more freedom in how to handle a failing connection. --- common/common/database.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/common/common/database.py b/common/common/database.py index bb34003..8bac136 100644 --- a/common/common/database.py +++ b/common/common/database.py @@ -19,8 +19,7 @@ class DBManager(object): returning them. It has the ability to serve as a primitive connection pool, as getting a - new conn will return existing conns it knows about first, but this mainly - just exists to re-use the initial conn used to test the connection, and you + new conn will return existing conns it knows about first, but you should use a real conn pool for any non-trivial use. Returned conns are set to seralizable isolation level, autocommit, and use @@ -30,9 +29,6 @@ class DBManager(object): self.conns = [] self.connect_timeout = connect_timeout self.connect_kwargs = connect_kwargs - # get a connection to test whether connection is working. - conn = self.get_conn() - self.put_conn(conn) def put_conn(self, conn): self.conns.append(conn)