Skip to content
This repository was archived by the owner on Aug 26, 2021. It is now read-only.

Commit ce83a4d

Browse files
authored
Merge pull request #29 from j00bar/patch-1
Use psycopg2 attr to test connection usability
2 parents 774f70f + 4035603 commit ce83a4d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

django_postgrespool/base.py

+4
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,7 @@ def _dispose(self):
101101
else:
102102
pool.dispose()
103103
del db_pool.pools[key]
104+
105+
def is_usable(self):
106+
# https://github.com/kennethreitz/django-postgrespool/issues/24
107+
return not self.connection.closed

0 commit comments

Comments
 (0)