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

Function reserveIds

apps/sim/lib/execution/event-buffer.ts:769–777  ·  view source on GitHub ↗
(minCount: number)

Source from the content-addressed store, hash-verified

767 }
768
769 const reserveIds = async (minCount: number) => {
770 const reserveCount = Math.max(RESERVE_BATCH, minCount)
771 const newMax = await redis.incrby(getSeqKey(executionId), reserveCount)
772 const startId = newMax - reserveCount + 1
773 if (nextEventId === 0 || nextEventId > maxReservedId) {
774 nextEventId = startId
775 maxReservedId = newMax
776 }
777 }
778
779 let flushPromise: Promise<boolean> | null = null
780 let closed = false

Callers 2

writeCoreFunction · 0.85
writeTerminalFunction · 0.85

Calls 1

getSeqKeyFunction · 0.70

Tested by

no test coverage detected