def write_notunique_log(self, log_id, log_type, fail_code, keyword, page_num): con = mdp.connection() cur = con.cursor() try: cur.execute(WeiboSearchLog.INSERT_NOTUNIQUE_LOG_SQL, ( log_id, log_type, fail_code, keyword, page_num, )) #need to faster con.commit() except: s = traceback.format_exc() scheduler_logger.warn(s) pass finally: cur.close() con.close()
def write_log(self, log_type, operation_status, fail_code, err_msg, crawl_feed_count=0, new_feed_count=0, run_time=0): con = mdp.connection() cur = con.cursor() try: cur.execute(WeiboSearchLog.INSERT_LOG_SQL, (log_type, operation_status, crawl_feed_count, new_feed_count, fail_code, err_msg, run_time, )) #need to faster con.commit() except: s = traceback.format_exc() scheduler_logger.warn(s) pass finally: cur.close() con.close()
def write_notunique_log(self, log_id, log_type, fail_code, keyword, page_num): con = mdp.connection() cur = con.cursor() try: cur.execute(WeiboSearchLog.INSERT_NOTUNIQUE_LOG_SQL, (log_id, log_type, fail_code, keyword, page_num, )) #need to faster con.commit() except: s = traceback.format_exc() scheduler_logger.warn(s) pass finally: cur.close() con.close()
def write_log(self, log_type, operation_status, fail_code, err_msg, crawl_feed_count=0, new_feed_count=0, run_time=0): con = mdp.connection() cur = con.cursor() try: cur.execute(WeiboSearchLog.INSERT_LOG_SQL, ( log_type, operation_status, crawl_feed_count, new_feed_count, fail_code, err_msg, run_time, )) #need to faster con.commit() except: s = traceback.format_exc() scheduler_logger.warn(s) pass finally: cur.close() con.close()