Merge branch 'feature/limit-threads' into develop
This commit is contained in:
		
						commit
						7c85082e7d
					
				@ -4,6 +4,10 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.6...1.3.8)
 | 
					[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.6...1.3.8)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Merged pull requests:**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Fix `git remote` parsing in case, when script running without parameters inside destination directory [\#61](https://github.com/skywinder/Github-Changelog-Generator/pull/61) ([skywinder](https://github.com/skywinder))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## [1.3.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.6) (2015-03-05)
 | 
					## [1.3.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.6) (2015-03-05)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.5...1.3.6)
 | 
					[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.5...1.3.6)
 | 
				
			||||||
 | 
				
			|||||||
@ -139,7 +139,7 @@ Here is a [wikipage list of alternatives](https://github.com/skywinder/Github-Ch
 | 
				
			|||||||
### Projects using this library
 | 
					### Projects using this library
 | 
				
			||||||
[Wikipage with list of projects](https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator) 
 | 
					[Wikipage with list of projects](https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator) 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
*If you are using `github_changelog_generator` for generation change log in your project or know of project that uses it, please add it to [this] (https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator) list.*
 | 
					*If you are using `github_changelog_generator` for generation change log in your project or know another project that uses it, please add it to [this] (https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator) list.*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Am I missed some essential feature?
 | 
					## Am I missed some essential feature?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -2,16 +2,28 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
## [Unreleased](https://github.com/skywinder/changelog_test/tree/HEAD)
 | 
					## [Unreleased](https://github.com/skywinder/changelog_test/tree/HEAD)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.2...HEAD)
 | 
					[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.3...HEAD)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**Merged pull requests:**
 | 
					**Merged pull requests:**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- Here is a test hotfix should appear in v.0.0.2 [\#2](https://github.com/skywinder/changelog_test/pull/2) ([skywinder](https://github.com/skywinder))
 | 
					- Add automatically generated change log file. [\#5](https://github.com/skywinder/changelog_test/pull/5) ([skywinder](https://github.com/skywinder))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [v0.0.3](https://github.com/skywinder/changelog_test/tree/v0.0.3) (2015-03-04)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.2...v0.0.3)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Merged pull requests:**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- fix \#3. hotfix. Should appear in v0.0.3 [\#4](https://github.com/skywinder/changelog_test/pull/4) ([skywinder](https://github.com/skywinder))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## [v0.0.2](https://github.com/skywinder/changelog_test/tree/v0.0.2) (2015-03-04)
 | 
					## [v0.0.2](https://github.com/skywinder/changelog_test/tree/v0.0.2) (2015-03-04)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.1...v0.0.2)
 | 
					[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.1...v0.0.2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Merged pull requests:**
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Here is a test hotfix should appear in v.0.0.2 [\#2](https://github.com/skywinder/changelog_test/pull/2) ([skywinder](https://github.com/skywinder))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## [v0.0.1](https://github.com/skywinder/changelog_test/tree/v0.0.1) (2015-03-02)
 | 
					## [v0.0.1](https://github.com/skywinder/changelog_test/tree/v0.0.1) (2015-03-02)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -593,38 +593,35 @@ module GitHubChangelogGenerator
 | 
				
			|||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      # Async fetching events:
 | 
					      # Async fetching events:
 | 
				
			||||||
      threads = []
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
      i = 0
 | 
					      fetch_events_async(@issues + @pull_requests)
 | 
				
			||||||
 | 
					 | 
				
			||||||
      @issues.each { |issue|
 | 
					 | 
				
			||||||
        threads << Thread.new {
 | 
					 | 
				
			||||||
          obj = @github.issues.events.list user: @options[:user], repo: @options[:project], issue_number: issue['number']
 | 
					 | 
				
			||||||
          issue[:events] = obj.body
 | 
					 | 
				
			||||||
          print "Fetching events for issues and PR: #{i+1}/#{@issues.count + @pull_requests.count}\r"
 | 
					 | 
				
			||||||
          i +=1
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      @pull_requests.each { |pull_request|
 | 
					 | 
				
			||||||
        threads << Thread.new {
 | 
					 | 
				
			||||||
          obj = @github.issues.events.list user: @options[:user], repo: @options[:project], issue_number: pull_request['number']
 | 
					 | 
				
			||||||
          pull_request[:events] = obj.body
 | 
					 | 
				
			||||||
          print "Fetching events for issues and PR: #{i+1}/#{@issues.count + @pull_requests.count}\r"
 | 
					 | 
				
			||||||
          i +=1
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      threads.each { |thr| thr.join }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
      #to clear line from prev print
 | 
					      #to clear line from prev print
 | 
				
			||||||
      print "                                                            \r"
 | 
					      print "                                                            \r"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if @options[:verbose]
 | 
					      if @options[:verbose]
 | 
				
			||||||
        puts "Fetching events for issues and PR: Done! #{i}/#{@issues.count + @pull_requests.count}"
 | 
					        puts 'Fetching events for issues and PR: Done!'
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def fetch_events_async(issues)
 | 
				
			||||||
 | 
					      i = 0
 | 
				
			||||||
 | 
					      max_thread_number = 50
 | 
				
			||||||
 | 
					      threads = []
 | 
				
			||||||
 | 
					      issues.each_slice(max_thread_number) { |issues_slice|
 | 
				
			||||||
 | 
					        issues_slice.each { |issue|
 | 
				
			||||||
 | 
					          threads << Thread.new {
 | 
				
			||||||
 | 
					            obj = @github.issues.events.list user: @options[:user], repo: @options[:project], issue_number: issue['number']
 | 
				
			||||||
 | 
					            issue[:events] = obj.body
 | 
				
			||||||
 | 
					            print "Fetching events for issues and PR: #{i+1}/#{@issues.count + @pull_requests.count}\r"
 | 
				
			||||||
 | 
					            i +=1
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        threads.each { |thr| thr.join }
 | 
				
			||||||
 | 
					        threads = []
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if __FILE__ == $0
 | 
					  if __FILE__ == $0
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user