askui
Version:
Reliable, automated end-to-end-testing that depends on what is shown on your screen instead of the technology you are running on
26 lines (25 loc) • 905 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.FixedRetryStrategy = void 0;
/**
* FixedRetryStrategy implements a retry strategy that uses a constant delay for each retry attempt.
*/
class FixedRetryStrategy {
/**
* @param baseDelayMs - The constant delay before each retry (default is 1000ms)
* @param retryCount - The maximum number of retries (default is 3)
*/
constructor(baseDelayMs = 1000, retryCount = 3) {
this.baseDelayMs = baseDelayMs;
this.retryCount = retryCount;
}
/**
* Returns the fixed delay for each retry attempt.
* @param _attempt - The current retry attempt number (not used in this strategy)
* @returns The fixed delay in milliseconds for the current attempt
*/
getDelay(_attempt) {
return this.baseDelayMs;
}
}
exports.FixedRetryStrategy = FixedRetryStrategy;