Async fetch events
This commit is contained in:
		
							parent
							
								
									c73142e169
								
							
						
					
					
						commit
						2cd6ba620d
					
				| @ -460,7 +460,22 @@ module GitHubChangelogGenerator | |||||||
|       end |       end | ||||||
| 
 | 
 | ||||||
|       if @options[:verbose] |       if @options[:verbose] | ||||||
|         puts "Filtered issues: #{filtered_issues.count}" |         print "Fetching events for issues...\r" | ||||||
|  |       end | ||||||
|  | 
 | ||||||
|  |       # Async fetching events: | ||||||
|  |       threads = [] | ||||||
|  | 
 | ||||||
|  |       filtered_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 | ||||||
|  |         } | ||||||
|  |         threads.each { |thr| thr.join } | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       if @options[:verbose] | ||||||
|  |         puts "Fetching events for issues: Done!" | ||||||
|       end |       end | ||||||
| 
 | 
 | ||||||
|       filtered_issues |       filtered_issues | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Petr Korolev
						Petr Korolev