Example #1
0
 def on_close(self):
     try:
         ChatSocketHandler.waiters.remove(self)
     except KeyError:
         pass
     if not database.is_closed():
         database.close()
Example #2
0
 def close(self):
     if not database.is_closed():
         database.close()
     try:
         ChatSocketHandler.waiters.remove(self)
     except KeyError:
         pass
     super().close()
Example #3
0
 def on_finish(self):
     if not database.is_closed():
         database.close()
     return super().on_finish()
Example #4
0
 def prepare(self):
     self.xsrf_token
     if not database.is_closed():
         database.close()
         database.connect()
     return super().prepare()