MCPcopy
hub / github.com/triggerdotdev/trigger.dev / wait

Method wait

packages/trigger-sdk/src/io.ts:362–371  ·  view source on GitHub ↗

`io.wait()` waits for the specified amount of time before continuing the Job. Delays work even if you're on a serverless platform with timeouts, or if your server goes down. They utilize [resumability](https://trigger.dev/docs/documentation/concepts/resumability) to ensure that the Run can be resume

(cacheKey: string | any[], seconds: number)

Source from the content-addressed store, hash-verified

360 * @param seconds The number of seconds to wait. This can be very long, serverless timeouts are not an issue.
361 */
362 async wait(cacheKey: string | any[], seconds: number) {
363 return await this.runTask(cacheKey, async (task) => {}, {
364 name: "wait",
365 icon: "clock",
366 params: { seconds },
367 noop: true,
368 delayUntil: new Date(Date.now() + seconds * 1000),
369 style: { style: "minimal" },
370 });
371 }
372
373 async waitForEvent<T extends z.ZodTypeAny = z.ZodTypeAny>(
374 cacheKey: string | any[],

Callers 15

exampleJob.jsFile · 0.80
exampleJob.jsFile · 0.80
exampleJob.jsFile · 0.80
trigger.tsFile · 0.80
example.server.tsFile · 0.80
example.tsFile · 0.80
index.tsFile · 0.80
example.tsFile · 0.80
status.tsFile · 0.80
airtable.tsFile · 0.80
canceling.tsFile · 0.80
invoke.tsFile · 0.80

Calls 1

runTaskMethod · 0.95

Tested by

no test coverage detected