diff options
author | Neil Johnson <neil@fragile.org.uk> | 2018-07-30 22:29:44 +0100 |
---|---|---|
committer | Neil Johnson <neil@fragile.org.uk> | 2018-07-30 22:29:44 +0100 |
commit | fef7e58ac63d58f4a13f0914f51fc5956981af6a (patch) | |
tree | 3e388f964e4af5bec4dddd5ef11fcd7767d472d7 /synapse/storage | |
parent | monthly_active_tests (diff) | |
download | synapse-fef7e58ac63d58f4a13f0914f51fc5956981af6a.tar.xz |
actually close conn
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/__init__.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py index 7b8215bf08..044e988e92 100644 --- a/synapse/storage/__init__.py +++ b/synapse/storage/__init__.py @@ -283,10 +283,14 @@ class DataStore(RoomMemberStore, RoomStore, GROUP BY user_id ) u """ - txn = self.db_conn.cursor() - txn.execute(sql, (thirty_days_ago,)) - count, = txn.fetchone() - return count + try: + txn = self.db_conn.cursor() + txn.execute(sql, (thirty_days_ago,)) + count, = txn.fetchone() + return count + finally: + txn.close() + def count_r30_users(self): |