Conversation
|
|
Hi @deepshekhardas, thanks for your interest in contributing! This project requires that pull request authors are vouched, and you are not in the list of vouched users. This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThe pull request adds documentation for a new TTL (Time-to-Live) feature across four documentation files. The changes introduce a three-tier TTL resolution model where per-trigger TTL takes precedence over task-level TTL, which takes precedence over global config-level TTL. Documentation includes examples for setting TTL at the config level in Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| ## TTL | ||
|
|
||
| You can set a default time-to-live (TTL) for all task runs in your project. If a run is not dequeued within this time, it will expire and never execute. | ||
|
|
||
| ```ts trigger.config.ts | ||
| import { defineConfig } from "@trigger.dev/sdk"; | ||
|
|
||
| export default defineConfig({ | ||
| project: "<project ref>", | ||
| // Your other config settings... | ||
| ttl: "1h", // Also accepts a number of seconds, e.g. 3600 | ||
| }); | ||
| ``` | ||
|
|
||
| You can override this on a per-task basis by setting `ttl` on the task definition, or per-trigger by passing `ttl` in the trigger options. To opt a specific task out of the config-level TTL, set `ttl: 0` on the task. See [Time-to-live (TTL)](/runs#time-to-live-ttl) for more information. |
There was a problem hiding this comment.
🚩 Documented TTL features not yet present in TypeScript types
The documentation describes setting ttl on task definitions (e.g. task({ id: "my-task", ttl: "10m", ... })) and in trigger.config.ts (e.g. defineConfig({ ttl: "1h" })). However, neither CommonTaskOptions at packages/core/src/v3/types/tasks.ts:173 nor TriggerConfig at packages/core/src/v3/config.ts:43 currently include a ttl property. Only the trigger-level ttl option exists (at packages/core/src/v3/types/tasks.ts:814 in the trigger options type). This suggests the docs are being written ahead of or in parallel with a feature PR that adds these type definitions. If the feature PR hasn't landed yet, merging these docs first would document non-existent functionality for users.
Was this helpful? React with 👍 or 👎 to provide feedback.
Closes #
✅ Checklist
Testing
[Describe the steps you took to test this change]
Changelog
[Short description of what has changed]
Screenshots
[Screenshots]
💯