def loop_execute(self): ctx = self.server.context while not self.should_die: db = Db(self.server) try: db.connect() self.store = db.store self.execute() except Exception: cherrypy.engine.exit() raise finally: db.disconnect() self.store = None
def connect(self): db = Db(self.server) db.connect() self.db = db self.store = db.store