-
Notifications
You must be signed in to change notification settings - Fork 39
feat: use cache when listing PRs and issues #616
Conversation
dd962b6
to
3034b92
Compare
1130c26
to
588a7ca
Compare
} | ||
items.push( | ||
...localItems.map(item => { | ||
return {repo, item}; | ||
}) | ||
); | ||
scanned++; | ||
orb1.text = `[${scanned}/${repos.length}] Scanning repos for PRs`; | ||
orb1.text = `[${scanned}/${repos.length}] Scanning repos for ${ | ||
type === 'issues' ? 'issue' : 'PR' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not familiar with type annotations in TypeScript and I'm really curious, is it possible to use String(type)
here instead? would simplify these quite a bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a ternary operator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean it's simple enough imo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, could just use ${type}
(type
is already a string internally), it's just singular "issue" vs plural "issues" being handled here. I didn't invent anything new here, I just copy-pasted this from another place in the code, there are quite a lot of those.
We have 167 repositories matching my filters at this moment. Quite often, I need to do several things one after one, e.g. first tag all matching PRs, then approve. Listing across 167 repositories every time is painful, takes time, and consumes quota.
Let's cache everything for 1 hour. The break glass
--nocache
option is also provided.