European Parliament MCP Server API - v1.3.10
    Preparing search index...

    Out-of-band warmup scheduler for the lifecycle-statistics cache.

    Typical lifecycle:

    const scheduler = new LifecycleWarmupScheduler();
    scheduler.start(); // production
    scheduler.start({ disable: true }); // tests
    await scheduler.refreshNow(); // explicit, returns once the
    // in-flight rebuild settles
    scheduler.dispose(); // shutdown

    refreshNow() returns a promise that callers can await for explicit priming on startup; failures are logged but never thrown so a transient EP-API outage does not crash the server.

    Index

    Constructors

    Properties

    failedAttempts: number = 0
    inFlight: Promise<LifecycleWarmupOutcome> | null = null
    intervalMs: number
    lastRefreshErrorAt: string | null = null
    lastRefreshErrorMessage: string | null = null
    lastSuccessAt: string | null = null
    successfulAttempts: number = 0
    timer: Timeout | null = null
    totalAttempts: number = 0

    Methods

    • Stop the periodic refresh and clear the timer. Any in-flight refresh is left to settle on its own (the underlying getLifecycleStatistics promise is not cancellable). Safe to call multiple times.

      Returns void

    • Run a single warmup attempt immediately.

      If a warmup is already in-flight the existing promise is returned so concurrent callers share the rebuild (de-duplication mirrors the getLifecycleStatistics in-flight mutex). Errors are logged via console.error and returned as { kind: 'error' }; they never throw out of this method so the scheduler stays alive across transient EP-API failures.

      Returns Promise<LifecycleWarmupOutcome>

      Outcome of the attempt (success counts, in-flight share, or sanitised error message).