Skip to content

fix: cap pagination per cron run to prevent CPU time limit#33

Merged
liplus-lin-lay merged 1 commit intomainfrom
30-pagination-cap
Apr 5, 2026
Merged

fix: cap pagination per cron run to prevent CPU time limit#33
liplus-lin-lay merged 1 commit intomainfrom
30-pagination-cap

Conversation

@liplus-lin-lay
Copy link
Copy Markdown
Member

Refs #30

初回同期時に 900+ issue のリポジトリで GitHub API 全件取得 + IssueStore upsert が Cloudflare Worker の CPU 時間制限を超過する問題を修正。

  • MAX_PAGES_PER_RUN = 5 定数を追加(1回の cron で最大500件)
  • fetchAllIssuesmaxPages パラメータと capped フラグを追加
  • ページ上限到達時は watermark を最後に取得した issue の updated_at に設定し、次回 cron で続きから取得

fetchAllIssues に maxPages パラメータを追加し、1回の cron 実行で
取得するページ数を MAX_PAGES_PER_RUN=5(500件)に制限。
900+ issue のリポジトリで初回同期時に Cloudflare Worker の
CPU 時間制限を超過する問題を解決する。

ページ上限到達時は watermark を pollStartTime ではなく
最後に取得した issue の updated_at に設定し、次回 cron で
続きから取得できるようにした。

Refs #30

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
github-rag-mcp 2caab52 Apr 05 2026, 01:50 PM

@liplus-lin-lay liplus-lin-lay merged commit ece4ad7 into main Apr 5, 2026
3 checks passed
@liplus-lin-lay liplus-lin-lay deleted the 30-pagination-cap branch April 5, 2026 13:51
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