From 6a818ca46788f3f68dcc5e78308d028a4c65d26c Mon Sep 17 00:00:00 2001 From: jrmullins Date: Wed, 14 Sep 2016 07:03:55 -0400 Subject: [PATCH] threaded request for team repo issues --- lib/lita/github_pr_list/pull_request.rb | 13 ++++++++----- lib/lita/github_pr_list/version.rb | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/lita/github_pr_list/pull_request.rb b/lib/lita/github_pr_list/pull_request.rb index b731aa1..d5e5d4f 100644 --- a/lib/lita/github_pr_list/pull_request.rb +++ b/lib/lita/github_pr_list/pull_request.rb @@ -25,15 +25,18 @@ def list private def get_pull_requests # Grab the issues and sort out the pull request issues by repos name - puts "Gathering PRs..." + threads = [] github_client.team_repositories(team_id).each do |repo| - github_client.list_issues(repo.id).each do |issue| - if issue.pull_request - issue.repository = repo - github_pull_requests << issue + threads << Thread.new do + github_client.list_issues(repo.id).each do |issue| + if issue.pull_request + issue.repository = repo + github_pull_requests << issue + end end end end + threads.map(&:join) end def build_summary diff --git a/lib/lita/github_pr_list/version.rb b/lib/lita/github_pr_list/version.rb index ad1bbad..5669f56 100644 --- a/lib/lita/github_pr_list/version.rb +++ b/lib/lita/github_pr_list/version.rb @@ -1,5 +1,5 @@ module Lita module GithubPrList - VERSION = "0.2.2" + VERSION = "0.3.1" end end