diff --git a/commands/edge_node.ts b/commands/edge_node.ts index 55ca96f..5c45e0f 100644 --- a/commands/edge_node.ts +++ b/commands/edge_node.ts @@ -148,12 +148,12 @@ export default class EdgeNode extends BaseCommand { // Inflating runs on a thread-pool thread: the next chunk inflates while this one is indexed. let pending: { to: number; text: Promise } | null = null for await (const frame of decodeFrames(await api.stream(range.id))) { + if (this.stopping) break if (isKeepalive(frame)) continue const next = { to: frame.to, text: unzipAsync(frame.data) } next.text.catch(() => {}) if (pending) await handle(pending) pending = next - if (this.stopping) break } if (pending && !this.stopping) await handle(pending) await posting