(id: string, options: { after?: number | "tail" } = {})
| 269 | } |
| 270 | |
| 271 | get(id: string, options: { after?: number | "tail" } = {}): ExecHandle { |
| 272 | const after = options.after ?? 0; |
| 273 | const record = this.records.get(id); |
| 274 | if (record?.live) { |
| 275 | // Live reattach: seed with whatever's already in the log |
| 276 | // past `after`, then continue with live events. |
| 277 | return { id, events: this.makeLiveStream(record, after === "tail" ? -1 : after) }; |
| 278 | } |
| 279 | const log = |
| 280 | record?.log ?? openLog(this.db, id, { maxBytes: this.opts.logMaxBytes, now: this.opts.now }); |
| 281 | if (log === undefined) { |
| 282 | throw new ExecError("ENOENT", `no exec record for id ${id}`); |
| 283 | } |
| 284 | return { id, events: replayToStream(log, after) }; |
| 285 | } |
| 286 | |
| 287 | kill(id: string, signal: NodeJS.Signals = "SIGTERM"): void { |
| 288 | const record = this.records.get(id); |
nothing calls this directly
no test coverage detected