Skip to content

feat(back): RailsからGitHubへの通信を並列化 close #15#49

Merged
topi-log merged 1 commit into
mainfrom
feat/#15_parallel_github_requests
Apr 26, 2026
Merged

feat(back): RailsからGitHubへの通信を並列化 close #15#49
topi-log merged 1 commit into
mainfrom
feat/#15_parallel_github_requests

Conversation

@topi-log

Copy link
Copy Markdown
Owner

Summary

  • get_all_files: 再帰的な contents API呼び出し(ディレクトリ数+ファイル数のAPIコール)を tree(recursive: true) による1回の呼び出しに置き換え、ファイルコンテンツ取得を Concurrent::Future で並列実行
  • commit_push: create_blob の逐次呼び出しを Concurrent::Future で並列実行
  • 上記に合わせて get_all_files_recursive を削除
  • get_all_files のテストを新規追加(Trees API呼び出し確認・ファイル一覧返却・各エラーケース)

背景

GitHub通信の時間がかかりメモリが落ちやすくなる問題の解消を目的とし、API呼び出し回数の削減と並列化で応答時間を短縮する。

変更前 変更後
get_all_files(10ファイル・3ディレクトリ) 13回以上の逐次APIコール 1回(tree)+ 10回並列コール
commit_push(Nファイル) N回逐次 N回並列

concurrent-ruby はRailsに同梱済みのため、gem追加なし。

Test plan

  • bundle exec rspec spec/services/github_spec.rb が全件グリーンであること
  • ローカルでリポジトリのファイル一覧取得・コミット保存が正常に動作すること

🤖 Generated with Claude Code

- get_all_files: 再帰的なcontents APIコールをtree(recursive: true)による1回の呼び出しに変更し、ファイルコンテンツ取得をConcurrent::Futureで並列実行
- commit_push: create_blob呼び出しをConcurrent::Futureで並列実行
- get_all_filesのテストを新規追加

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
leaf-record Ready Ready Preview, Comment Apr 26, 2026 7:30am

@topi-log topi-log merged commit 9726cd4 into main Apr 26, 2026
6 checks passed
@topi-log topi-log deleted the feat/#15_parallel_github_requests branch April 26, 2026 10:39
@topi-log topi-log changed the title feat(back): RailsからGitHubへの通信を並列化 feat(back): RailsからGitHubへの通信を並列化 close #15 Apr 26, 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.

1 participant