MCPcopy
hub / github.com/promptfoo/promptfoo / createTimeout

Method createTimeout

src/python/worker.ts:222–230  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

220 }
221
222 private createTimeout(): Promise<never> {
223 return new Promise((_, reject) => {
224 this.requestTimeout = setTimeout(() => {
225 reject(new Error(`Python worker timed out after ${this.timeout}ms`));
226 }, this.timeout);
227 // Prevent timeout from keeping Node.js event loop alive
228 this.requestTimeout.unref();
229 });
230 }
231
232 private handleDone(responseFile: string): void {
233 const normalizedResponseFile = responseFile.replace(/[\r\n]+$/, '');

Callers 1

callMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected