Accept more than 100 events in activity plugin
This commit is contained in:
@@ -19,11 +19,21 @@ export default async function({login, data, rest, q, account, imports}, {enabled
|
||||
if (!days)
|
||||
days = Infinity
|
||||
skipped.push(...data.shared["repositories.skipped"])
|
||||
const pages = Math.ceil(limit/100)
|
||||
const codelines = 2
|
||||
|
||||
//Get user recent activity
|
||||
console.debug(`metrics/compute/${login}/plugins > activity > querying api`)
|
||||
const {data:events} = context.mode === "repository" ? await rest.activity.listRepoEvents({owner:context.owner, repo:context.repo}) : await rest.activity.listEventsForAuthenticatedUser({username:login, per_page:100})
|
||||
const events = []
|
||||
try {
|
||||
for (let page = 1; page <= pages; page++) {
|
||||
console.debug(`metrics/compute/${login}/plugins > activity > loading page ${page}`)
|
||||
events.push(...(context.mode === "repository" ? await rest.activity.listRepoEvents({owner:context.owner, repo:context.repo}) : await rest.activity.listEventsForAuthenticatedUser({username:login, per_page:100})).data)
|
||||
}
|
||||
}
|
||||
catch {
|
||||
console.debug(`metrics/compute/${login}/plugins > activity > no more page to load`)
|
||||
}
|
||||
console.debug(`metrics/compute/${login}/plugins > activity > ${events.length} events loaded`)
|
||||
|
||||
//Extract activity events
|
||||
|
||||
Reference in New Issue
Block a user