We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c03d126 commit a314c70Copy full SHA for a314c70
1 file changed
services/libs/data-access-layer/src/packages/downloadsLast30d.ts
@@ -163,9 +163,12 @@ export async function upsertLast30dDownload(
163
)
164
const changed = row.changed_fields
165
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.
168
const rowCount = await qx.result(
169
`UPDATE packages
- SET downloads_last_30d = $(count)
170
+ SET downloads_last_30d = $(count),
171
+ last_synced_at = NOW()
172
WHERE purl = $(purl) AND downloads_last_30d IS DISTINCT FROM $(count)`,
173
{ count, purl },
174
0 commit comments