feat: implement cron window spread backend - #4566
Conversation
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThe change adds schedule windows with duration and percentage formats, validation, persistence, and API presentation. The schedule engine now calculates nominal and effective schedule times, derives deterministic phases, and propagates both timestamps through scheduling and triggering. Task runs now store nullable queue timestamps in ClickHouse. Queue handling records queue wait time and prevents fast-path delivery for future messages. Tests cover schedule timing, recovery, queue timestamps, and future queue eligibility. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
@trigger.dev/build
trigger.dev
@trigger.dev/core
@trigger.dev/python
@trigger.dev/react-hooks
@trigger.dev/redis-worker
@trigger.dev/rsc
@trigger.dev/schema-to-json
@trigger.dev/sdk
commit: |
Observability mapAs of Nothing in this pull request moves the report any more. The findings an earlier push reported are gone. The score and findings here are report-only and never gate the merge. Separately, a required test suite keeps this tool's symbol and route lists in sync with the code they name, and can fail a pull request that renames or removes a symbol they reference, or that adds the first route with a segment they anticipate. Each failure names the list to edit. The rules and their reasons: internal-packages/observability-map/README.md. |
6a532cc to
eab11b2
Compare
The merge with #4577 (scope declarative schedule sync to the current environment) narrowed the existingDeclarativeSchedules findMany to a select that omitted generatorExpression, timezone, windowDurationSeconds and windowPercentage. The timingChanged comparison reads those fields to decide whether to preserve the existing Redis job, so they must be selected.
eab11b2 to
6d46620
Compare
Summary
Add the backend plumbing for cron schedule spreading/delaying.
Changes
queueTimestampfor the "effectiveAt" delayed start time, propagate it to Clickhouse TaskRun tableFlag
When switched on:
TODO: