UNPKG

1 kBTypeScriptView Raw
1import { ILogger } from '../../common';
2export interface ResolvedConnectionErrorHandlerOptions {
3 readonly serverName: string;
4 readonly logger: ILogger;
5 /**
6 * The maximum amount of errors allowed before stopping the server.
7 */
8 readonly maxErrors: number;
9 /**
10 * The minimum amount of restarts allowed in the restart interval.
11 */
12 readonly maxRestarts: number;
13 /**
14 * In minutes.
15 */
16 readonly restartInterval: number;
17}
18export declare type ConnectionErrorHandlerOptions = Partial<ResolvedConnectionErrorHandlerOptions> & {
19 readonly serverName: string;
20 readonly logger: ILogger;
21};
22export declare class ConnectionErrorHandler {
23 protected readonly options: ResolvedConnectionErrorHandlerOptions;
24 constructor(options: ConnectionErrorHandlerOptions);
25 shouldStop(error: Error, count?: number): boolean;
26 protected readonly restarts: number[];
27 shouldRestart(): boolean;
28}
29//# sourceMappingURL=connection-error-handler.d.ts.map
\No newline at end of file