summaryrefslogtreecommitdiff
path: root/lib/github/client.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2017-09-27 09:30:55 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2017-09-27 09:30:55 +0000
commitccdfd85d87f3ff1c49bc4552b55efaefa8fa5f70 (patch)
treec51687460f96df90cf3d3011c2479bc11c8982e0 /lib/github/client.rb
parent05d8e87dba4abaf9eb495bac147c4d4c5426da2e (diff)
parent62120acf1d8a7b3abecfff71900ed423c1fdf473 (diff)
downloadgitlab-ce-ccdfd85d87f3ff1c49bc4552b55efaefa8fa5f70.tar.gz
Merge branch '38198-fetch-github-api-per-100' into 'master'
Resolve "GitHub import should fetch 100 results per page to limit the change to hit rate limiting" Closes #38198 See merge request gitlab-org/gitlab-ce!14421
Diffstat (limited to 'lib/github/client.rb')
-rw-r--r--lib/github/client.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/github/client.rb b/lib/github/client.rb
index 9c476df7d46..29bd9c1f39e 100644
--- a/lib/github/client.rb
+++ b/lib/github/client.rb
@@ -1,6 +1,7 @@
module Github
class Client
TIMEOUT = 60
+ DEFAULT_PER_PAGE = 100
attr_reader :connection, :rate_limit
@@ -20,7 +21,7 @@ module Github
exceed, reset_in = rate_limit.get
sleep reset_in if exceed
- Github::Response.new(connection.get(url, query))
+ Github::Response.new(connection.get(url, { per_page: DEFAULT_PER_PAGE }.merge(query)))
end
private