22 lines
1.3 KiB
JavaScript
22 lines
1.3 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.runHealthScript = exports.checkWebUrl = exports.checkPortListening = void 0;
|
|
exports.timeoutPromise = timeoutPromise;
|
|
const runHealthScript_1 = require("./runHealthScript");
|
|
Object.defineProperty(exports, "runHealthScript", { enumerable: true, get: function () { return runHealthScript_1.runHealthScript; } });
|
|
var checkPortListening_1 = require("./checkPortListening");
|
|
Object.defineProperty(exports, "checkPortListening", { enumerable: true, get: function () { return checkPortListening_1.checkPortListening; } });
|
|
var checkWebUrl_1 = require("./checkWebUrl");
|
|
Object.defineProperty(exports, "checkWebUrl", { enumerable: true, get: function () { return checkWebUrl_1.checkWebUrl; } });
|
|
/**
|
|
* Create a promise that rejects after the specified timeout.
|
|
* Useful for racing against long-running health checks.
|
|
*
|
|
* @param ms - Timeout duration in milliseconds
|
|
* @param options.message - Custom error message (defaults to "Timed out")
|
|
* @returns A promise that never resolves, only rejects after the timeout
|
|
*/
|
|
function timeoutPromise(ms, { message = 'Timed out' } = {}) {
|
|
return new Promise((resolve, reject) => setTimeout(() => reject(new Error(message)), ms));
|
|
}
|
|
//# sourceMappingURL=index.js.map
|