(executionId: string)
| 360 | } |
| 361 | |
| 362 | function getMemoryStream(executionId: string): MemoryExecutionStream { |
| 363 | pruneExpiredMemoryStreams() |
| 364 | let stream = memoryExecutionStreams.get(executionId) |
| 365 | if (!stream) { |
| 366 | stream = { |
| 367 | events: [], |
| 368 | meta: null, |
| 369 | nextEventId: 1, |
| 370 | expiresAt: Date.now() + TTL_SECONDS * 1000, |
| 371 | } |
| 372 | memoryExecutionStreams.set(executionId, stream) |
| 373 | } |
| 374 | return stream |
| 375 | } |
| 376 | |
| 377 | function touchMemoryStream(stream: MemoryExecutionStream): void { |
| 378 | stream.expiresAt = Date.now() + TTL_SECONDS * 1000 |
no test coverage detected