Skip to content

REV feed on a ten-minute cron, staged in steps within the free plan's CPU - #55

Merged
sushilm20 merged 2 commits into
mainfrom
feat/rev-feed-schedule
Oct 28, 2026
Merged

sushilm20 merged 2 commits into
mainfrom
feat/rev-feed-schedule

Conversation

@sushilm20

Copy link
Copy Markdown
Contributor

REV's official feed was published by hand on 2026-10-27 and nothing refreshed it, because every cron is paused. This schedules REV's feed job only; the four vendor crawls stay off.

CPU. Staging all 976 rows in one run took about 17 ms in a fresh Node process (parse 10 ms, stage 7 ms), over the free plan's 10 ms. runRevFeed now takes one small step per run:

  • a download (at most every six hours, with the ETag) checks the body is a list of at least 500 rows and keeps it in KV;
  • each later run stages 125 rows as one batch and appends them to the index;
  • the last of those writes the manifest and deletes the saved body;
  • a later run validates and publishes, as before.

Measured per step on the real feed, one fresh process each: 3.4–7.4 ms; idle runs 0.5–1.1 ms.

Schedule. */10 * * * *, mapped to REV in cronVendors. An idle run writes nothing, an unchanged check writes one key, and a changed feed costs about 35 KV writes and deletes and goes live about 100 minutes after its download.

Safety. A build is dropped, with its batches and saved body, when:

  • a step fails;
  • a catalog is published by hand meanwhile;
  • it is still unfinished three hours after its download, so a step stopped at the CPU limit cannot retry every ten minutes.

A SKU listed twice keeps its first row. The top-level ETag changes only when staging completes.

Tests: stepped staging, a duplicate SKU, a mostly unusable feed found halfway, abandonment by a manual publish, the three-hour cutoff, and the cron test (only REV scheduled).

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; both previously reported issues are addressed.

Summary

Schedules REV’s official feed every ten minutes while leaving vendor crawls paused. Downloads and staging run in separate steps before publication.

  • REV’s feed now runs on a ten-minute schedule while vendor crawls stay paused.
  • Changed REV feeds are staged a little at a time before they go live.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Ten-minute cron] --> B{Pending work?}
  B -->|No| C{Six hours since check?}
  C -->|No| D[Skip]
  C -->|Yes| E[Download feed]
  E --> F[Save changed body]
  B -->|Building| G[Stage up to 125 rows]
  G --> H{All rows staged?}
  H -->|No| I[Save progress]
  H -->|Yes| J[Write manifest]
  B -->|Staged| K[Validate and publish]
  G -->|Failure or timeout| L[Discard unfinished build]
Loading

Reviews (2) · Last reviewed commit: "Greptile: a retried REV step ignores its..." · Reviewed by Greptile

Comment thread apps/worker/src/rev-feed.ts Resolved
Comment thread apps/worker/src/rev-feed.ts Resolved
…leanup covers a batch written before a failed save
@sushilm20

Copy link
Copy Markdown
Contributor Author

@greptileai

@sushilm20
sushilm20 merged commit f7fc3bb into main Oct 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant