MCPcopy Index your code
hub / github.com/simstudioai/sim / withTimeout

Function withTimeout

apps/sim/lib/knowledge/documents/service.ts:146–157  ·  view source on GitHub ↗
(
  promise: Promise<T>,
  timeoutMs: number,
  operation = 'Operation'
)

Source from the content-addressed store, hash-verified

144}
145
146function withTimeout<T>(
147 promise: Promise<T>,
148 timeoutMs: number,
149 operation = 'Operation'
150): Promise<T> {
151 return Promise.race([
152 promise,
153 new Promise<never>((_, reject) =>
154 setTimeout(() => reject(new Error(`${operation} timed out after ${timeoutMs}ms`)), timeoutMs)
155 ),
156 ])
157}
158
159const PROCESSING_CONFIG = {
160 maxConcurrentDocuments:

Callers 1

processDocumentAsyncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected