def close(self):
""" Close the database connection, return True on success. """
with self.num_connections_lock:
self.num_connections -= 1
if self.num_connections == 0:
try:
self.database.close()
if DEBUG:
LOG.debug("[db] Database closed")
except OperationalError as exc:
_DbConnector.log_error("close", exc)
return False
return True
评论列表
文章目录