async def get_failed_indicators_and_retry():
    """Get failed indicators data from checkpoint and try creating them again."""
    __method_name = inspect.currentframe().f_code.co_name
    try:
        total_retry_indicators = 0
        retry_success = 0
        retry_failure = 0
        parent_dir = ShareDirectoryClient.from_connection_string(
            conn_str=consts.CONNECTION_STRING,
            share_name=consts.MS_SHARE_NAME,
            directory_path="",
        )
        failed_files = list_checkpoint_files(parent_dir)
        if not failed_files:
            applogger.info(
                "{}(method={}) : {} : No files found.".format(
                    consts.LOGS_STARTS_WITH,
                    __method_name,
                    consts.RETRY_FAILED_INDICATORS,
                )
            )
            return
        file_names_to_query = return_file_names_to_query_in_the_current_execution(
            failed_files
        )
        if not file_names_to_query:
            applogger.info(
                "{}(method={}) : {} : No previously failed indicators found.".format(
                    consts.LOGS_STARTS_WITH,
                    __method_name,
                    consts.RETRY_FAILED_INDICATORS,
                )
            )
            return
        for file in file_names_to_query:
            failed_indicators = get_failed_indicators(file)
            if not failed_indicators:
                applogger.info(
                    "{}(method={}) : {} : No Failed indicators found in the file-{}.".format(
                        consts.LOGS_STARTS_WITH,
                        __method_name,
                        consts.RETRY_FAILED_INDICATORS,
                        file,
                    )
                )
                continue

            result = await post_failed_indicators(failed_indicators)
            if result["failure_count"] > 0:
                post_data(
                    body=json.dumps(result["failed_indicators"]),
                    log_type=consts.FAILED_INDICATORS_TABLE_NAME,
                )
                applogger.info(
                    "{}(method={}) : {} : Posted {} failed indicators to log analytics.".format(
                        consts.LOGS_STARTS_WITH,
                        __method_name,
                        consts.RETRY_FAILED_INDICATORS,
                        len(result["failed_indicators"]),
                    )
                )
            total_retry_indicators += len(failed_indicators)
            retry_success += result["success_count"]
            retry_failure += result["failure_count"]
            delete_file_from_file_share(file, parent_dir)
            applogger.info(
                "{}(method={}) : {} : Succesfully deleted the file, filename : {}.".format(
                    consts.LOGS_STARTS_WITH,
                    __method_name,
                    consts.RETRY_FAILED_INDICATORS,
                    file,
                )
            )
        applogger.info(
            "{}(method={}) : {} : Total collected Failed Indicators : {}, "
            "posted indicators into sentinel: {}, "
            "failed indicators while posting : {}.".format(
                consts.LOGS_STARTS_WITH,
                __method_name,
                consts.RETRY_FAILED_INDICATORS,
                total_retry_indicators,
                retry_success,
                retry_failure,
            )
        )
    except CofenseIntelligenceException:
        applogger.error(
            "{}(method={}) : {} : Retrying Failed Indicators incurred an error.".format(
                consts.LOGS_STARTS_WITH,
                __method_name,
                consts.RETRY_FAILED_INDICATORS,
            )
        )
        raise CofenseIntelligenceException()
    except Exception as error:
        applogger.error(
            "{}(method={}) : {} : Retrying Failed Indicators incurred an error, Error: {}.".format(
                consts.LOGS_STARTS_WITH,
                __method_name,
                consts.RETRY_FAILED_INDICATORS,
                error,
            )
        )
        raise CofenseIntelligenceException()
Get failed indicators data from checkpoint and try creating them again.
Solutions/CofenseIntelligence/Data Connectors/CofenseIntelligenceDataConnector/RetryFailedIndicators/retry_failed_indicators.py