pentf
    Preparing search index...

    Function timeoutPromise

    • Raise an error if a promise does not finish within a certain timeframe. Note this does not cancel the promise itself (because that's impossible).

      Parameters

      • config: any

        The pentf configuration.

      • promise: Promise<any>

        The promise to limit

      • timeout: {
            expectNothing?: boolean;
            message?: string;
            timeout?: number;
            warning?: number;
        } = {}

        Timeout in ms (by default 10000=10s)

      Returns any

      Whatever the promise returned, if it is successful