import { Model, Document } from 'mongoose'; import { ILogger } from '../../definitions'; import { ConnectionManager } from './connection'; /** * Retry execution utilities for repository operations * Handles connection retry logic and model refresh during retries */ export interface RetryExecutorConfig { name: string; logger?: ILogger; maxRetries?: number; retryDelay?: number; } /** * Executes database operations with retry logic and connection management */ export declare class RetryExecutor { private readonly config; private readonly connectionManager; private readonly defaultModel; private readonly maxRetries; private readonly retryDelay; constructor(config: RetryExecutorConfig, connectionManager: ConnectionManager, defaultModel: Model); /** * Wraps a database operation with connection retry logic * Operation factory is called in each retry attempt to get fresh model */ executeWithRetry(operationFactory: (getModel: () => Promise>) => Promise, domain: string | undefined, operationName: string): Promise; /** * Handles connection recreation during retry attempts */ private recreateConnection; }