feat(back): RailsからGitHubへの通信を並列化 close #15#49
Merged
Conversation
- 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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
get_all_files: 再帰的なcontentsAPI呼び出し(ディレクトリ数+ファイル数の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ディレクトリ)commit_push(Nファイル)concurrent-rubyはRailsに同梱済みのため、gem追加なし。Test plan
bundle exec rspec spec/services/github_spec.rbが全件グリーンであること🤖 Generated with Claude Code