Skip to content

chore(cron): drop tripwire ingest to hourly, build-stats to daily#36

Merged
n2p5 merged 1 commit into
mainfrom
chore/tripwire-cron-cadence
May 21, 2026
Merged

chore(cron): drop tripwire ingest to hourly, build-stats to daily#36
n2p5 merged 1 commit into
mainfrom
chore/tripwire-cron-cadence

Conversation

@n2p5
Copy link
Copy Markdown
Contributor

@n2p5 n2p5 commented May 21, 2026

Summary

Neon compute on the func.lol DB was pinned at ~24h/day on the Launch plan because tripwire-ingest ran every 5 minutes — exactly the auto-suspend window — so the compute never had a chance to idle out.

  • tripwire-ingest: */5 * * * *0 * * * *
  • tripwire-build-stats: */15 * * * *0 4 * * * (1h after the daily ASN refresh, so it always sees the fresh mmdb)
  • tripwire-asn-update: unchanged

The hourly cadence is safe because INGEST_WINDOW_DAYS = 2 in src/lib/tripwire/ingest.ts — the lookback is window-based, not interval-based. Two UTC days leaves ~47h of slack against a cron outage. Comment updated to reflect hourly instead of 5-min.

Expected effect: DB compute drops from ~24h/day to seconds × 24 hourly runs + one daily build-stats run, comfortably inside the 5-min auto-suspend at 0.25 vCPU.

Neon compute on the func.lol DB was pinned at ~24h/day because the
ingest cron fired every 5 minutes — exactly the auto-suspend window.
Ingest only inserts into tripwire_events, and the lookback is
INGEST_WINDOW_DAYS (2), so the cadence is independent of the window.
Build-stats runs once daily at 04:00 UTC, an hour after the ASN refresh
so it always reads the freshest mmdb.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
func-lol Ready Ready Preview, Comment May 21, 2026 12:35pm

Request Review

@n2p5 n2p5 merged commit d71cdc1 into main May 21, 2026
5 of 6 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