Handle the fact that postgres databases can be restarted from under us

This commit is contained in:
Erik Johnston 2015-04-27 12:40:49 +01:00
parent 865398b4a9
commit e4c4664d73
3 changed files with 33 additions and 1 deletions

View file

@ -39,3 +39,6 @@ class PostgresEngine(object):
if isinstance(error, self.module.DatabaseError):
return error.pgcode in ["40001", "40P01"]
return False
def is_connection_closed(self, conn):
return bool(conn)