MCPcopy Index your code
hub / github.com/lissy93/web-check / createTimeoutPromise

Function createTimeoutPromise

api/_common/middleware.js:53–59  ·  view source on GitHub ↗
(timeoutMs)

Source from the content-addressed store, hash-verified

51const commonMiddleware = (handler) => {
52 // Create a timeout promise, to throw an error if a request takes too long
53 const createTimeoutPromise = (timeoutMs) => {
54 return new Promise((_, reject) => {
55 setTimeout(() => {
56 reject(new Error(`Request timed-out after ${timeoutMs} ms`));
57 }, timeoutMs);
58 });
59 };
60
61 // Vercel
62 const vercelHandler = async (request, response) => {

Callers 2

vercelHandlerFunction · 0.85
netlifyHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected