(minCount: number)
| 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 |
no test coverage detected