def _ns_discard(dbfly): MotherPool._pool_current-= 1 MotherPool._del_orphan(dbfly) try: dbfly._close() except Exception, ss: Speaker.log_error("Unable to close connection: %s", ERR_COL(ss))
def _del_orphan(db): m= MotherPool._pool_orphans_mutex m.acquire() try: MotherPool._pool_orphans.pop(id(db)) except: Speaker.log_error("Unable to close de-orphan connection: %s, %s, %s", ERR_COL(MotherPool._pool_orphans), ERR_COL(db), ERR_COL(id(db))) m.release()