checkShouldRetry(config, statusCode) {
        // Add your custom retry limit if necessary
        if (config.totalRetries > process.env.RETRY_LIMIT) {
            return { retryAfter: 0, shouldRetry: false };
        }

        if (statusCode === 408 || statusCode === 429) {
            return { retryAfter: 60, shouldRetry: true };
        }

        if (statusCode >= 500 && statusCode !== 501 && config.timeElapsed < 3600) {
            return {
                retryAfter: config.totalRetries > 0 ? 300 : 60,
                shouldRetry: true
            };
        }

        return { retryAfter: 0, shouldRetry: false };
    }
/**
     * Check whether a request should retry or not.
     * The code should wait for 60 seconds before retrying.
     * If the status code is in the range of 500,
     * the code should retry after 60 seconds, followed by every 300 seconds until 3600 seconds.
     * For more information: https://developer-guide.sovos.com/connect-once-api/general-concepts/responses
     * 
     * @param {{totalRetries: number, timeElapsed: number}} config axios' custom error config object
     * @param {number} statusCode HTTP Status Code
     * @returns {{retryAfter: number, shouldRetry: boolean}}
     */
Check whether a request should retry or not.
The code should wait for 60 seconds before retrying.
If the status code is in the range of 500,
the code should retry after 60 seconds, followed by every 300 seconds until 3600 seconds.

@param {{totalRetries: number, timeElapsed: number}} config axios' custom error config object
@param {number} statusCode HTTP Status Code
@returns {{retryAfter: number, shouldRetry: boolean}}
Check whether a request should retry or not . The code should wait for 60 seconds before retrying . If the status code is in the range of 500 the code should retry after 60 seconds followed by every 300 seconds until 3600 seconds . @param {{ totalRetries : number timeElapsed : number }} config axios ' custom error config object @param { number } statusCode HTTP Status Code @returns {{ retryAfter : number shouldRetry : boolean }}
checkShouldRetry(config, statusCode) {
        if (config.totalRetries > process.env.RETRY_LIMIT) {
            return { retryAfter: 0, shouldRetry: false };
        }
        if (statusCode === 408 || statusCode === 429) {
            return { retryAfter: 60, shouldRetry: true };
        }
        if (statusCode >= 500 && statusCode !== 501 && config.timeElapsed < 3600) {
            return {
                retryAfter: config.totalRetries > 0 ? 300 : 60,
                shouldRetry: true
            };
        }
        return { retryAfter: 0, shouldRetry: false };
    }
checkShouldRetry ( config , statusCode ) { if ( config . totalRetries > process . env . RETRY_LIMIT ) { return { retryAfter : 0 , shouldRetry : false } ; } if ( statusCode === 408 || statusCode === 429 ) { return { retryAfter : 60 , shouldRetry : true } ; } if ( statusCode >= 500 && statusCode !== 501 && config . timeElapsed < 3600 ) { return { retryAfter : config . totalRetries > 0 ? 300 : 60 , shouldRetry : true } ; } return { retryAfter : 0 , shouldRetry : false } ; }
Check whether a request should retry or not.
Check whether a request should retry or not .
// Add your custom retry limit if necessary