Use psycopg2 attr to test connection usability

Fixes #24
This commit is contained in:
Joshua "jag" Ginsberg
2016-03-11 13:53:31 -05:00
parent 38cb08ad45
commit 4035603eb2
+4
View File
@@ -95,3 +95,7 @@ class DatabaseWrapper(Psycopg2DatabaseWrapper):
else:
pool.dispose()
del db_pool.pools[key]
def is_usable(self):
# https://github.com/kennethreitz/django-postgrespool/issues/24
return not self.connection.closed