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 getPullRequest = async (number, owner, repo) => {
|
||||||
const name = `${owner}-${repo}-pull-${number}`
|
const name = `${owner}-${repo}-pull-${number}`
|
||||||
return checkCache(name, async () => {
|
const retryableFunc = () => octokit.pulls.get({ pull_number: number, owner, repo })
|
||||||
return runRetryable(octokit.pulls.get({
|
return checkCache(name, () => runRetryable(retryableFunc, MAX_FAIL_COUNT))
|
||||||
number,
|
|
||||||
owner,
|
|
||||||
repo
|
|
||||||
}), MAX_FAIL_COUNT)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const getComments = async (number, owner, repo) => {
|
const getComments = async (number, owner, repo) => {
|
||||||
const name = `${owner}-${repo}-pull-${number}-comments`
|
const name = `${owner}-${repo}-issue-${number}-comments`
|
||||||
return checkCache(name, async () => {
|
const retryableFunc = () => octokit.issues.listComments({ issue_number: number, owner, repo, per_page: 100 })
|
||||||
return runRetryable(octokit.issues.listComments({
|
return checkCache(name, () => runRetryable(retryableFunc, MAX_FAIL_COUNT))
|
||||||
number,
|
|
||||||
owner,
|
|
||||||
repo,
|
|
||||||
per_page: 100
|
|
||||||
}), MAX_FAIL_COUNT)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const addRepoToPool = async (pool, repo, from, to) => {
|
const addRepoToPool = async (pool, repo, from, to) => {
|
||||||
|
|
Loading…
Reference in a new issue