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

Function dispatchPart

apps/sim/lib/uploads/core/storage-service.ts:293–308  ·  view source on GitHub ↗
(body: Buffer)

Source from the content-addressed store, hash-verified

291 }
292
293 const dispatchPart = async (body: Buffer): Promise<void> => {
294 // Bound concurrency: wait for a free slot before starting another part.
295 while (inflight.size >= MULTIPART_MAX_INFLIGHT) await Promise.race(inflight)
296 if (firstError) throw firstError
297 const be = await ensureBackend()
298 const partNo = ++partNumber
299 const p = be
300 .uploadPart(partNo, body)
301 .catch((err) => {
302 firstError ??= err
303 })
304 .finally(() => {
305 inflight.delete(p)
306 })
307 inflight.add(p)
308 }
309
310 const abort = async (): Promise<void> => {
311 aborted = true

Callers 2

writeFunction · 0.85
completeFunction · 0.85

Calls 4

ensureBackendFunction · 0.85
uploadPartMethod · 0.80
deleteMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected