MCPcopy Create free account
hub / github.com/6174/comflowyspace / withTimeout

Function withTimeout

apps/node/src/routes/api/bootstrap.ts:97–104  ·  view source on GitHub ↗
(task: Promise<any>, timeout: number, errorMessage: string)

Source from the content-addressed store, hash-verified

95 })
96 }
97 async function withTimeout(task: Promise<any>, timeout: number, errorMessage: string): Promise<boolean> {
98 const timeoutId = setTimeout(() => {
99 newDispatcher({ type: 'TIMEOUT', message: errorMessage });
100 }, timeout);
101 const ret = await task;
102 clearTimeout(timeoutId);
103 return ret;
104 }
105
106 const msgTemplate = (type: string, solution = "") => `${type} operation timed out.${solution} If you can't go through this issue. Please reach out to us on Discord or refer to our FAQ for assistance. We are open to offer 1v1 support.`
107 let task: Promise<any>;

Callers 1

ApiBootstrapFunction · 0.85

Calls 1

newDispatcherFunction · 0.70

Tested by

no test coverage detected