tdpw
Version:
CLI tool for uploading Playwright test reports to TestDino platform with TestDino storage support
31 lines • 1.16 kB
TypeScript
/**
* Retry utility with exponential backoff and circuit breaker
* Handles network failures and temporary service unavailability
*/
/**
* Configuration options for retry behavior
*/
export interface RetryOptions {
/** Maximum number of attempts (default: 3) */
maxAttempts?: number;
/** Base delay in milliseconds (default: 1000) */
baseDelay?: number;
/** Maximum delay in milliseconds (default: 30000) */
maxDelay?: number;
/** Backoff factor (default: 2) */
factor?: number;
/** Timeout per attempt in milliseconds (default: 120000 = 2 minutes) */
timeout?: number;
/** Function to determine if error should trigger retry */
shouldRetry?: (error: Error) => boolean;
}
/**
* Execute an operation with retry logic and exponential backoff
*/
export declare function withRetry<T>(operation: () => Promise<T>, options?: RetryOptions): Promise<T>;
/**
* Specialized retry for file upload operations
* Uses different retry logic optimized for large file uploads
*/
export declare function withFileUploadRetry<T>(operation: () => Promise<T>, _fileName?: string): Promise<T>;
//# sourceMappingURL=retry.d.ts.map