From 0d5bb48eade808f5e1ae952b39e3c8ff4a59288e Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Tue, 19 May 2015 14:01:30 +0200 Subject: [PATCH] Close connection when querying other members of cluster --- helpers/postgresql.py | 1 + requirements.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/helpers/postgresql.py b/helpers/postgresql.py index 4110f93e..72030e6d 100644 --- a/helpers/postgresql.py +++ b/helpers/postgresql.py @@ -156,6 +156,7 @@ class Postgresql: xlog_diff = member_cursor.fetchone()[0] logger.info([self.name, member.hostname, xlog_diff]) member_cursor.close() + member_conn.close() if xlog_diff < 0: return False except psycopg2.OperationalError: diff --git a/requirements.txt b/requirements.txt index 33cd5ae3..2185e5c6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ PyYAML -requests psycopg2 +requests