fix: "TypeError: fn is not a function" crash in release notes generator (#19394)
* fix: fix cache filename of issue comments * fix: update octokit deprecated API use * fix: "TypeError: fn is not a function" in notes.js * chore: retryableFunc does not need to be async * chore: simplify checkCache() operation param
This commit is contained in:
parent
a25b15bc2a
commit
898adbce5c
1 changed files with 5 additions and 16 deletions
|
@ -319,25 +319,14 @@ async function runRetryable (fn, maxRetries) {
|
|||
|
||||
const getPullRequest = async (number, owner, repo) => {
|
||||
const name = `${owner}-${repo}-pull-${number}`
|
||||
return checkCache(name, async () => {
|
||||
return runRetryable(octokit.pulls.get({
|
||||
number,
|
||||
owner,
|
||||
repo
|
||||
}), MAX_FAIL_COUNT)
|
||||
})
|
||||
const retryableFunc = () => octokit.pulls.get({ pull_number: number, owner, repo })
|
||||
return checkCache(name, () => runRetryable(retryableFunc, MAX_FAIL_COUNT))
|
||||
}
|
||||
|
||||
const getComments = async (number, owner, repo) => {
|
||||
const name = `${owner}-${repo}-pull-${number}-comments`
|
||||
return checkCache(name, async () => {
|
||||
return runRetryable(octokit.issues.listComments({
|
||||
number,
|
||||
owner,
|
||||
repo,
|
||||
per_page: 100
|
||||
}), MAX_FAIL_COUNT)
|
||||
})
|
||||
const name = `${owner}-${repo}-issue-${number}-comments`
|
||||
const retryableFunc = () => octokit.issues.listComments({ issue_number: number, owner, repo, per_page: 100 })
|
||||
return checkCache(name, () => runRetryable(retryableFunc, MAX_FAIL_COUNT))
|
||||
}
|
||||
|
||||
const addRepoToPool = async (pool, repo, from, to) => {
|
||||
|
|
Loading…
Reference in a new issue