Member Junction
    Preparing search index...
    • Wraps a promise with a timeout. Rejects with OperationTimeoutError if the promise does not resolve within the specified duration.

      CAVEAT — this does NOT cancel the wrapped operation. It is a Promise.race, so on timeout the underlying work keeps running to completion (or its own failure) with nobody awaiting it. A caller that retries a timed-out operation therefore stacks a second copy on top of the first, still in-flight — which is why IntegrationEngine's fetch path does not retry OperationTimeoutError. Real cancellation needs an AbortSignal threaded into the connector contract; until then, treat a timeout as terminal for that attempt.

      Type Parameters

      • T

      Parameters

      • promise: Promise<T>

        The promise to wrap

      • timeoutMs: number

        Timeout in milliseconds

      • operationName: string

        Name of the operation for error messaging

      Returns Promise<T>

      The result of the promise

      OperationTimeoutError if the operation times out