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

Function ensureBackend

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

Source from the content-addressed store, hash-verified

282 const drainPending = (): Buffer<ArrayBuffer> => Buffer.concat(pendingChunks, pendingBytes)
283
284 const ensureBackend = async (): Promise<MultipartBackend> => {
285 if (!backend) {
286 backend = USE_BLOB_STORAGE
287 ? await createBlobBackend(key, createBlobConfig(config), contentType)
288 : await createS3Backend(key, createS3Config(config), contentType, context)
289 }
290 return backend
291 }
292
293 const dispatchPart = async (body: Buffer): Promise<void> => {
294 // Bound concurrency: wait for a free slot before starting another part.

Callers 1

dispatchPartFunction · 0.85

Calls 4

createBlobBackendFunction · 0.85
createBlobConfigFunction · 0.85
createS3BackendFunction · 0.85
createS3ConfigFunction · 0.85

Tested by

no test coverage detected