Task execution limits being explicitly tied to compute time
Developers should have a clearer understanding of task limits, as the configuration is being updated to explicitly measure CPU compute time rather than total wall-clock duration.
Task timeouts are being made more transparent. By explicitly labeling limits as compute time rather than total duration, developers can better understand how their tasks consume resources. This distinction matters when tasks involve long periods of waiting or sleeping, as wall-clock time no longer creates confusion around timeout rules.
The system is deprecating the generic duration limit in favor of a specific parameter. Users can clearly see that idle time spent waiting for external systems does not count against their task execution limits.
Under the hood, the execution engine maps the to the existing duration checks while keeping the old configuration fully supported for backwards compatibility.
Here is how you configure the new compute time limit on a task:
1export const heavyTask = task({2 id: "heavy-task",3 maxComputeSeconds: 300,4 run: async (payload, { ctx }) => {}5});
View Original GitHub Description
Deprecate maxDuration in favour of maxComputeSeconds while preserving backwards compatibility
Details
- Add maxComputeSeconds setting and related handling
- Update templates to reflect new option
- Documentation updates for maxComputeSeconds
Todo
- Create preview package release
- Test init creates trigger.config with the correct template
- Test that maxDuration still works on trigger.config
- Test that maxDuration override still works on a task
- Test that maxComputeSeconds works in trigger.config
- Test that maxComputeSeconds override works on a task