示例#1
0
    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
示例#2
0
 def connect(self):
     db = Db(self.server)
     db.connect()
     self.db = db
     self.store = db.store