Skip to content

Commit 73ba79e

Browse files
committed
docs: simplify packagist drift notes
Signed-off-by: anilb <epipav@gmail.com>
1 parent 188728d commit 73ba79e

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

  • services/apps/packages_worker/src/packagist

services/apps/packages_worker/src/packagist/README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,10 @@ never overwritten — the first observation (closest to the boundary) wins.
135135
Packagist keeps no history, so unlike npm there is no backfill lane; a missed
136136
month stays missed. State: `downloads_30d_last_run_at` + `downloads_30d_run_result`.
137137

138-
`monthlyWindowFor()` labels `end_date` from whatever *month* the batch executes
139-
in — not the exact day — so a drain that runs long but stays inside the same
140-
month is still labeled consistently. The one gap: if the full-catalog drain
141-
ever dragged on long enough to spill past the next month's 1st, later batches
142-
would get mislabeled with the new month's `end_date` instead of the run's.
143-
Unlike the daily lane (see below), this isn't pinned to a fixed run cutoff —
144-
low risk given the run should finish in hours, not weeks, but worth knowing.
138+
Unlike the daily lane (see below), the write-date here isn't pinned to a fixed
139+
run cutoff — if the full-catalog drain ran long enough, the labeled window
140+
could drift forward from what was true when the run started. Low risk given
141+
the run should finish in hours, not weeks, but worth knowing.
145142

146143
---
147144

@@ -162,11 +159,10 @@ the registry's rolling daily figure.
162159
**Populates:** one `downloads_daily` row per package per day (`package_id`,
163160
run date, count), with the run date pinned once from the run's `cutoff` so
164161
every row from one run shares the same label even if the drain runs long.
165-
That only fixes the *label*, though — Packagist computes `daily` live,
166-
relative to the moment each package is actually fetched, so a drain that
167-
runs past real UTC midnight still hands back a value already drifted toward
168-
the new day for whichever packages are processed last, stored under the
169-
older date. State: `daily_downloads_last_run_at` + `daily_downloads_run_result`.
162+
That only fixes the *label*, though — Packagist computes `daily` live at
163+
fetch time, so for a long-running drain the underlying value can drift
164+
forward from what the label implies for whichever packages are processed
165+
last. State: `daily_downloads_last_run_at` + `daily_downloads_run_result`.
170166

171167
---
172168

0 commit comments

Comments
 (0)