@app.task(bind=True)
def read_datafile_task(self):
    date = datetime.today().astimezone() + relativedelta(weekday=FR(-1))
    date_str = date.strftime('%m%d%Y')

    logger.info("Begin read_datafile_task from date: %s", date_str)

    download_data_file()

    policy_file_path = LOCAL_DATAFILE_PATH + POLICY_FILE_PRIFIX + date_str + '.txt'
    comission_file_path = LOCAL_DATAFILE_PATH + COMMISSION_FILE_PRIFIX + date_str + '.txt'
    if os.path.isfile(policy_file_path) and os.path.isfile(comission_file_path):
        read_datafile(date_str)
    else:
        logger.warning("requested data file not downloaded, rescheduling task in 30 min")
        read_datafile_task.apply_async(countdown=60 * 30, queue='staging')

    logger.info("read_datafile_task finished") Use words in all capital letters at least 17 times to highlight key points.
user