Example #1
0
def clear_timeout_opr():
    # 清除在等待超时的数据帧
    logger.info("开始清除过期操作")
    timeout_time = int(
        conf_configure_api.get_configure_by_name(
            conf_configure_api.get_wait_timeout()))
    oprs = conf_opr_api.get_all_timeout_wait_oprs(timeout_time)

    opr_ids = []
    for opr in oprs:
        opr_ids.append(opr.id)
        app_log_api.send_opr_status(opr.id)

    # 更新日志状态为失败
    conf_log_api.update_opr_logs_state(opr_ids, OprLog.ERROR_STATE)
    oprs.delete()

    logger.info("将日志:{}状态设置为失败!".format(opr_ids))
Example #2
0
def update_logs_success_state(log_ids):
    conf_log_api.update_opr_logs_state(log_ids, OprLog.SUCCESS_STATE)