def check(): SELOG.info( "----------------------------------------------------------------------" ) SELOG.info("[server] check [start]") #rpc_check.start_check() SELOG.info("[server] check [end]")
def check(): SELOG.info( "----------------------------------------------------------------------" ) SELOG.info("[api] check [start]") db = dm.Manager() db.api_check() # rpc_check.start_check() SELOG.info("[api] check [end]")
def api_check(self): SELOG.info("[database] check [start]") conn = None try: conn = connection.Connection(conf_dict=self.db_conf) conn.close() except MySQLdb.Error, e: print "database error:%s" % (str(e)) SELOG.error("database connection fail:%s" % (str(e))) SELOG.info("[database] check [end]") sys.exit(1)
def start_check(self): # check the database consistence when service start # the task status must be end or auto_end, change running to stop SELOG.info("[database] check [start]") conn = None try: conn = connection.Connection(conf_dict=self.db_conf) except MySQLdb.Error, e: print "database error:%s" % (str(e)) SELOG.error("database connection fail:%s" % (str(e))) SELOG.info("[database] check [end]") sys.exit(1)
def sigint_callback(signum, frame): SELOG.info("-" * 71) SELOG.info("receive sigint, agent service stop") #re.re_manager.end_all() sys.exit(0)
def check(): SELOG.info("----------------------------------------------------------------------") SELOG.info("[agent] check [start]") #rpc_check.start_check() SELOG.info("[agent] check [end]")
DBLOG.error("database.get_items - project-%s req-%s get items:%d" % (project_name, req_id, item_num)) return True, result def api_check(self): SELOG.info("[database] check [start]") conn = None try: conn = connection.Connection(conf_dict=self.db_conf) conn.close() except MySQLdb.Error, e: print "database error:%s" % (str(e)) SELOG.error("database connection fail:%s" % (str(e))) SELOG.info("[database] check [end]") sys.exit(1) SELOG.info("[database] check [end]") def start_check(self): # check the database consistence when service start # the task status must be end or auto_end, change running to stop SELOG.info("[database] check [start]") conn = None try: conn = connection.Connection(conf_dict=self.db_conf) except MySQLdb.Error, e: print "database error:%s" % (str(e)) SELOG.error("database connection fail:%s" % (str(e))) SELOG.info("[database] check [end]") sys.exit(1) SELOG.info("database connection success")