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

Function complete

apps/sim/lib/uploads/core/storage-service.ts:335–358  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

333 }
334 },
335 async complete() {
336 try {
337 if (!backend) {
338 // Never crossed one part (or local provider): single-shot upload.
339 await uploadFile({
340 file: drainPending(),
341 fileName: key,
342 contentType,
343 context,
344 preserveKey: true,
345 customKey: key,
346 })
347 return { key, size: totalBytes }
348 }
349 if (pendingBytes > 0) await dispatchPart(drainPending())
350 await Promise.all(inflight)
351 if (firstError) throw firstError
352 await backend.finish()
353 return { key, size: totalBytes }
354 } catch (err) {
355 await abort()
356 throw err
357 }
358 },
359 abort,
360 }
361}

Callers

nothing calls this directly

Calls 5

uploadFileFunction · 0.85
drainPendingFunction · 0.85
dispatchPartFunction · 0.85
abortFunction · 0.70
finishMethod · 0.65

Tested by

no test coverage detected