Skip to content

perf(feed): recompute the trending board every 30 minutes - #666

Merged
harlan-zw merged 1 commit into
mainfrom
fix/issue-665
Oct 31, 2026
Merged

harlan-zw merged 1 commit into
mainfrom
fix/issue-665

Conversation

@harlan-github-agent

Copy link
Copy Markdown
Contributor

🔗 Linked issue

Closes #665

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

The d1-query-review routine measured the trending feed at 3,196 executions and 112.9 million row reads in one week, up 72% with post volume, and the cause sits in the feed's cache window: the board recomputed its full 14-day post scan every five minutes, while its fastest input, X posts from sync-x-mentions, lands every 15 minutes at most. Two of every three recomputes could not have seen new data.

The feed now holds its answer for 30 minutes, a full ingest cadence, and keeps the hour-long stale fallback so a D1 overload still serves the last good board. The compute is untouched, so rankings stay identical; only how often they are recomputed changes. Four nearby comments stated the old five-minute window as fact (the /skills/trending edge-cache rationale in nuxt.config.ts, the homepage and browse-page fetches, the v1 proxy); they now say 30 minutes.

One tradeoff worth a reviewer's eye: the board's "as of" timestamp can now lag an ingest by up to 30 minutes instead of 5. I left the /skills/trending edge rule (60s fresh, 3600s stale) alone; its stale window already assumed inputs move on a 15-minute cadence.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 20, 2026
@harlan-github-agent

harlan-github-agent Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 MERGED

Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy. Last updated: 2026-10-31 04:54 UTC.

GitHub merged this pull request.

No material findings were recorded.

e30a6be3-9c3e-4b30-85fb-7d916419290c

@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 20, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 20, 2026

@harlan-github-agent harlan-github-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Harlan Agent Kit posted this automated review. AI open source policy.

Automated Review: READY.

Read the Review results

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.

Trending feed rescans the full post window every five minutes

1 participant