github_issue_stats 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/github_issue_stats.rb +9 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 584023f0b309d682ce01d9eefc8c813a84e674a3
|
4
|
+
data.tar.gz: a9e5debe40753e153a1d596320fb4b5077f2acd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4494ae87500a0ea1d8e57a839d23b2843b8387aa4af3292293b508addade3a0c03f63e4610ba9bea4e640b0964311bf9f5b76346e25ba946ec17d449d96cad35
|
7
|
+
data.tar.gz: 3acf46b8732045a8f46b15b16543d0f8453593d0e205cac8e522603119cc628a3b743a7f147b381014d64f068ab70861908c53b959e3242578c7c8cfc1663c25
|
data/lib/github_issue_stats.rb
CHANGED
@@ -30,7 +30,7 @@ module Enumerable
|
|
30
30
|
end
|
31
31
|
|
32
32
|
class GitHubIssueStats
|
33
|
-
VERSION = "0.
|
33
|
+
VERSION = "0.7.0"
|
34
34
|
|
35
35
|
attr_accessor :client, # Octokit client for acesing the API
|
36
36
|
:logger, # Logger for writing debugging info
|
@@ -47,7 +47,7 @@ class GitHubIssueStats
|
|
47
47
|
begin
|
48
48
|
@client = Octokit::Client.new(
|
49
49
|
:access_token => token,
|
50
|
-
:auto_paginate =>
|
50
|
+
:auto_paginate => false,
|
51
51
|
:user_agent => "GitHubIssueStats/#{VERSION} (@izuzak) #{Octokit.user_agent}"
|
52
52
|
)
|
53
53
|
|
@@ -197,7 +197,7 @@ class GitHubIssueStats
|
|
197
197
|
STDERR.flush
|
198
198
|
end
|
199
199
|
|
200
|
-
result = @client.search_issues(query_string)
|
200
|
+
result = @client.search_issues(query_string, {:per_page => 1})
|
201
201
|
@logger.debug "Total count: #{result.total_count}"
|
202
202
|
|
203
203
|
if result.incomplete_results
|
@@ -275,15 +275,15 @@ class GitHubIssueStats
|
|
275
275
|
|
276
276
|
rate_limit_data = @client.get("https://api.github.com/rate_limit")
|
277
277
|
|
278
|
-
if rate_limit_data[:resources][:core][:remaining]
|
278
|
+
if rate_limit_data[:resources][:core][:remaining] <= 2
|
279
279
|
reset_timestamp = rate_limit_data[:resources][:core][:reset]
|
280
|
-
sleep_seconds = reset_timestamp - Time.now.to_i
|
281
|
-
@logger.warn "Remaining regular API rate limit is 0, sleeping for #{sleep_seconds} seconds."
|
280
|
+
sleep_seconds = reset_timestamp - Time.now.to_i + 3
|
281
|
+
@logger.warn "Remaining regular API rate limit is close to 0, sleeping for #{sleep_seconds} seconds."
|
282
282
|
sleep(sleep_seconds)
|
283
|
-
|
283
|
+
elsif rate_limit_data[:resources][:search][:remaining] <= 2
|
284
284
|
reset_timestamp = rate_limit_data[:resources][:search][:reset]
|
285
|
-
sleep_seconds = reset_timestamp - Time.now.to_i
|
286
|
-
@logger.warn "Remaining search API rate limit is 0, sleeping for #{sleep_seconds} seconds."
|
285
|
+
sleep_seconds = reset_timestamp - Time.now.to_i + 3
|
286
|
+
@logger.warn "Remaining search API rate limit is close to 0, sleeping for #{sleep_seconds} seconds."
|
287
287
|
sleep(sleep_seconds)
|
288
288
|
elsif
|
289
289
|
sleep(1)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github_issue_stats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Zuzak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|