Reduced number of GitHub requests (#1298)

This commit is contained in:
Samuel Colvin 2019-10-09 14:34:20 +01:00 committed by Martin Donath
parent f138b9591d
commit 6ac6fa4a9e

View File

@ -59,8 +59,8 @@ export default class GitHub extends Abstract {
* @return {Promise<Array<string>>} Promise returning an array of facts
*/
fetch_() {
const paginate = (page = 0) => {
return fetch(`${this.base_}?per_page=30&page=${page}`)
const paginate = (page = 0) => (
fetch(`${this.base_}?per_page=100&sort=updated&page=${page}`)
.then(response => response.json())
.then(data => {
if (!(data instanceof Array))
@ -87,7 +87,7 @@ export default class GitHub extends Abstract {
]
}
})
}
)
/* Paginate through repos */
return paginate()