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."