Skip to content

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

Open
harlan-github-agent[bot] wants to merge 1 commit into
mainfrom
fix/issue-665
Open

harlan-github-agent[bot] wants to merge 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

🤖 QUEUED

Harlan Agent Kit posted this automated review. AI open source policy. The Dashboard shows the exact Queue position.

Next: Review starts when an Agent is free.

@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-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
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

0 participants