Skip to content

Commit a314c70

Browse files
committed
fix: bump last_synced_at on packagist 30d mirror
Signed-off-by: anilb <epipav@gmail.com>
1 parent c03d126 commit a314c70

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

services/libs/data-access-layer/src/packages/downloadsLast30d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,12 @@ export async function upsertLast30dDownload(
163163
)
164164
const changed = row.changed_fields
165165
if (mirrorToPackages) {
166+
// last_synced_at is the Tinybird ENGINE_VER for the packages datasource — it must
167+
// move whenever a real column changes, or Tinybird can keep serving a stale row.
166168
const rowCount = await qx.result(
167169
`UPDATE packages
168-
SET downloads_last_30d = $(count)
170+
SET downloads_last_30d = $(count),
171+
last_synced_at = NOW()
169172
WHERE purl = $(purl) AND downloads_last_30d IS DISTINCT FROM $(count)`,
170173
{ count, purl },
171174
)

0 commit comments

Comments
 (0)