fix(schedules): count usage lim error schedule as failed run#4853
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview The important behavior change is HTTP 402 (usage limit) during preprocessing: those attempts are now counted as failed runs (while still scheduling the next normal cadence) so a schedule stuck over quota can eventually auto-disable instead of retrying indefinitely. Successful runs still reset Reviewed by Cursor Bugbot for commit 0d5e813. Configure here. |
Greptile SummaryThis PR fixes a runaway-schedule bug by treating HTTP 402 (usage-limit) responses as failed runs, so the shared
Confidence Score: 5/5Safe to merge — the change is a targeted fix with a clean refactor and no regressions introduced. The behavioural change is small and intentional: a 402 response now increments the consecutive-failure counter, matching how every other non-retryable failure is handled. The refactoring that centralises buildScheduleFailureUpdate is mechanical — each replaced inline object contained exactly the same fields with the same expressions. The 429 path is correctly left unchanged. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[executeScheduleJob] --> B{Preprocess result\nstatus code}
B -->|404| C[Disable schedule immediately]
B -->|429| D[Delay 5 min, reset infraRetryCount\nfailCount unchanged]
B -->|402| E[buildScheduleFailureUpdate\nnextRunAt = cron cadence or +1h]
B -->|5xx retryable| F[retryScheduleAfterInfraFailure]
B -->|other error| G[buildScheduleFailureUpdate\nnextRunAt = determineNextRunAfterError]
B -->|success| H[Run workflow]
E --> I[failedCount++\nlastFailedAt = now\nstatus = disabled if >= MAX_CONSECUTIVE_FAILURES]
G --> I
F -->|retries exhausted| I
H -->|failure result| J[buildScheduleFailureUpdate]
H -->|execution error| K[buildScheduleFailureUpdate]
J --> I
K --> I
H -->|success| L[Reset failedCount = 0\nstatus = active]
Reviews (2): Last reviewed commit: "remove backoff logic" | Re-trigger Greptile |
|
@greptile |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 0d5e813. Configure here.
Summary
402s should be treated as failed runs to prevent runaway schedules.
Type of Change
Testing
N/A
Checklist