Skip to content

fix: honest check cadence, and a stats snapshot that fits the 30-min cache - #3

Merged
Eras256 merged 18 commits into
masterfrom
fix/stats-archive-freshness-and-schedule-note
Nov 22, 2026
Merged

Eras256 merged 18 commits into
masterfrom
fix/stats-archive-freshness-and-schedule-note

Conversation

@M0nsxx

@M0nsxx M0nsxx commented Nov 21, 2026

Copy link
Copy Markdown
Member

Arregla el job diario de /stats, que el 20 nov no guardó instantánea, y deja de prometer chequeos "cada 5 minutos" que GitHub no cumple. Es la parte de este repo de la revisión del sitio del 21 nov (F3 y T2).

Qué incluye

Código Cambio Cómo lo comprobé
F3 .upptimerc.yml: "Checks are scheduled every 5 minutes; GitHub runs scheduled jobs late, sometimes hours apart." Corridas de uptime.yml del 21-nov a las 10:24, 11:31 y 18:11 UTC (según la revisión).
T2 stats-archive.yml: acepta datos de /api/stats de hasta 35 min (antes 10) y guarda su generatedAt real; 8 lecturas en vez de 5; un segundo intento a las 18:17 UTC que solo corre si la mañana no guardó nada (si el archivo del día ya existe, sale sin tocar nada). Ver abajo.

Por qué 35 min y no un parámetro en la URL

  • El 20-nov falló con /api/stats kept serving data older than 10 minutes: en 5 intentos los datos tenían 21-25 min.
  • La ruta del sitio (apps/web/app/api/stats/route.ts) tiene revalidate = 1800 y Cache-Control: s-maxage=1800, stale-while-revalidate=3600. O sea, 30 min es su ventana normal, no 5.
  • La revisión proponía saltarse la caché con ?snapshot=<fecha>. Lo probé hoy y no funciona: con y sin parámetro, Vercel devolvió la misma copia X-Vercel-Cache: STALE, age: 2603, el mismo generatedAt. Por eso usé la otra opción.
  • Un día perdido no se rellena después: no se crea la instantánea del 20-nov.

Pruebas

  • Los dos YAML parsean (yaml.safe_load).
  • No corrí el workflow (no hay workflow_dispatch desde aquí sin efectos: hace commit en master). Se puede probar con "Run workflow" después del merge; si ya existe la instantánea del día, el paso nuevo debe salir con "Today's snapshot already exists".

Relacionado

El texto de /stats ("si un día falla, el hueco queda a la vista") va en Eras256/nirium-core-private#241, y el de /developers sobre la caché de 30 min va en el PR de docs/developers de esa misma revisión.

No hay merge desde aquí.

🤖 Generated with Claude Code

M0nsxx and others added 18 commits November 21, 2026 16:32
…cache

- F3: "Checks run every 5 minutes" -> scheduled every 5 minutes; GitHub
  runs scheduled jobs late, sometimes hours apart (seen 21 Nov 2026).
- T2: the 20 Nov snapshot failed because the job wanted data under 10 min
  old while /api/stats is cached up to 30 min (revalidate 1800); all five
  reads were 21-25 min old. A query string does not bypass the cache
  (checked 21 Nov: same STALE copy). Accept up to 35 min and record the
  real generatedAt, read 8 times, and try once more at 18:17 UTC if the
  morning run recorded nothing. A missed day is never filled in later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@Eras256 Eras256 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-assisted comment (Claude)

The workflow change (35-min freshness, 18:17 UTC retry, skip if today's snapshot exists) and the README wording look right. Could you drop the 17 history/*.yml files from this PR? They are Upptime's own response-time data; the bot rewrites them on main and they will conflict. Then it's ready.

@Eras256
Eras256 merged commit 558fe25 into master Nov 22, 2026
1 check passed
@Eras256
Eras256 deleted the fix/stats-archive-freshness-and-schedule-note branch November 22, 2026 00:07
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.

3 participants