Skip to content

Commit da2e5e0

Browse files
committed
Docs for troubleshooting concurrent waits
1 parent 1b3a6c0 commit da2e5e0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/troubleshooting.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,21 @@ Your code is deployed separately from the rest of your app(s) so you need to mak
8080

8181
Prisma uses code generation to create the client from your schema file. This means you need to add a bit of config so we can generate this file before your tasks run: [Read the guide](/config/config-file#prisma).
8282

83+
### `Parallel waits are not supported`
84+
85+
In the current version, you can't perform more that one "wait" in parallel.
86+
87+
Waits include:
88+
- `wait.for()`
89+
- `wait.until()`
90+
- `task.triggerAndWait()`
91+
- `task.batchTriggerAndWait()`
92+
- And any of our functions with `wait` in the name.
93+
94+
This restriction exists because we suspend the task server after a wait, and resume it when the wait is done. At the moment, if you do more than one wait, the run will never continue when deployed, so we throw this error instead.
95+
96+
The most common situation this happens is if you're using `Promise.all` around some of our wait functions. Instead of doing this use our built-in functions for [triggering tasks](/triggering#triggering-from-inside-another-task). We have functions that allow you to trigger different tasks in parallel.
97+
8398
### When triggering subtasks the parent task finishes too soon
8499

85100
Make sure that you always use `await` when you call `trigger`, `triggerAndWait`, `batchTrigger`, and `batchTriggerAndWait`. If you don't then it's likely the task(s) won't be triggered because the calling function process can be terminated before the networks calls are sent.

0 commit comments

Comments
 (0)