Example #1
0
def run_send_failed_mt_thread():
    logging.info("Send failed mt thread started.")
    INTERVAL = int(ConfHelper.SMS_CONF.failed_mt_interval)
    status = ErrorCode.FAILED
    mt = MT()
    try:
        while True:
            time.sleep(INTERVAL)
            status = mt.fetch_failed_mt_sms()
            if status == ErrorCode.SUCCESS:
                INTERVAL = int(ConfHelper.SMS_CONF.failed_mt_interval)
            else:
                INTERVAL = INTERVAL * 2
                if INTERVAL > 600:
                    INTERVAL = 600
    except Exception as e:
        logging.exception("Start send failed MT thread failed: %s", e.args)