From 2cafff7abb58486e5b3f42b254aa96ab486283dc Mon Sep 17 00:00:00 2001 From: Andrew Waage Date: Tue, 24 May 2016 09:46:08 -0700 Subject: [PATCH] changing max threads to 4 --- .../generator/generator_fetcher.rb | 5 +++-- lib/github_changelog_generator/octo_fetcher.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/github_changelog_generator/generator/generator_fetcher.rb b/lib/github_changelog_generator/generator/generator_fetcher.rb index 22c03aa..8f93f62 100644 --- a/lib/github_changelog_generator/generator/generator_fetcher.rb +++ b/lib/github_changelog_generator/generator/generator_fetcher.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true module GitHubChangelogGenerator class Generator + MAX_THREAD_NUMBER = 4 + # Fetch event for issues and pull requests # @return [Array] array of fetched issues def fetch_events_for_issues_and_pr @@ -35,8 +37,7 @@ module GitHubChangelogGenerator def detect_actual_closed_dates(issues) print "Fetching closed dates for issues...\r" if @options[:verbose] - max_thread_number = 50 - issues.each_slice(max_thread_number) do |issues_slice| + issues.each_slice(MAX_THREAD_NUMBER) do |issues_slice| threads = [] issues_slice.each do |issue| threads << Thread.new { find_closed_date_by_commit(issue) } diff --git a/lib/github_changelog_generator/octo_fetcher.rb b/lib/github_changelog_generator/octo_fetcher.rb index 8934d3a..e26b067 100644 --- a/lib/github_changelog_generator/octo_fetcher.rb +++ b/lib/github_changelog_generator/octo_fetcher.rb @@ -7,7 +7,7 @@ module GitHubChangelogGenerator class OctoFetcher PER_PAGE_NUMBER = 100 - MAX_THREAD_NUMBER = 50 + MAX_THREAD_NUMBER = 4 CHANGELOG_GITHUB_TOKEN = "CHANGELOG_GITHUB_TOKEN" GH_RATE_LIMIT_EXCEEDED_MSG = "Warning: Can't finish operation: GitHub API rate limit exceeded, change log may be " \ "missing some issues. You can limit the number of issues fetched using the `--max-issues NUM` argument."