MCPcopy
hub / github.com/prisma/prisma / settleOnePromise

Function settleOnePromise

packages/client/src/runtime/utils/waitForBatch.ts:29–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27 let settledPromisesCount = 0
28
29 const settleOnePromise = () => {
30 if (done) {
31 return
32 }
33 settledPromisesCount++
34 if (settledPromisesCount === promises.length) {
35 done = true
36 if (bestError) {
37 reject(bestError)
38 } else {
39 resolve(successfulResults)
40 }
41 }
42 }
43
44 const immediatelyReject = (error: unknown) => {
45 if (!done) {

Callers 1

waitForBatchFunction · 0.85

Calls 1

resolveFunction · 0.50

Tested by

no test coverage detected