Skip to content

Commit e0166b1

Browse files
committed
coderabbit changes
1 parent 9c63ae2 commit e0166b1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/troubleshooting.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,14 +275,16 @@ If the above doesn't work, then we recommend you try increasing the machine size
275275

276276
### Realtime stream error (`sendBatchNonBlocking` / `S2AppendSession`)
277277

278-
Errors mentioning `sendBatchNonBlocking`, `@s2-dev/streamstore`, or `S2AppendSession` (often with `code: undefined`) can occur when you close a stream and then await `waitUntilComplete()`, or when a stream runs for a long time (e.g. 20+ minutes). Wrap `waitUntilComplete()` in try/catch so it doesn't fail your task:
278+
Errors mentioning `sendBatchNonBlocking`, `@s2-dev/streamstore`, or `S2AppendSession` (often with `code: undefined`) can occur when you close a stream and then await `waitUntilComplete()`, or when a stream runs for a long time (e.g. 20+ minutes). Wrap `waitUntilComplete()` in try/catch so Transport/closed-stream errors don't fail your task:
279279

280280
```ts
281+
import { streams } from "@trigger.dev/sdk";
282+
283+
const { waitUntilComplete } = streams.pipe("my-stream", dataStream); // or streams.writer(...)
281284
try {
282-
this.closeNodeUpdatesStream();
283-
await nodeUpdatesRealtime?.waitUntilComplete();
285+
await waitUntilComplete();
284286
} catch (err) {
285-
// Transport/closed-stream; log if needed
287+
// Transport/closed-stream; log if needed or ignore
286288
}
287289
```
288290

0 commit comments

Comments
 (0)