chore: retry upload add delay (#50302)

This commit is contained in:
vagusX 2024-08-08 14:48:18 +08:00 committed by GitHub
parent 3f3999cd1b
commit 05083493b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,7 +19,7 @@ if (args.length < 2) {
const ALI_OSS_BUCKET = 'antd-visual-diff';
function retry(promise, retries, delay) {
function retry(promise, retries, delay = 3000) {
return new Promise((resolve, reject) => {
const attempt = () => {
promise.then(resolve).catch((error) => {
@ -136,7 +136,7 @@ async function boot() {
if (stat.isFile()) {
const doUpload = uploadFile(client, workspacePath, refValue);
try {
await retry(doUpload, 3, 1000);
await retry(doUpload, 3);
} catch (err) {
console.error(
'Uploading file `%s` failed after retry %s, error: %s',
@ -155,7 +155,7 @@ async function boot() {
const doUpload = uploadFile(client, file, refValue);
try {
// eslint-disable-next-line no-await-in-loop
await retry(doUpload, 3, 1000);
await retry(doUpload, 3);
} catch (err) {
console.warn(
'Skip uploading file `%s` in folder `%s` failed after retry %s, error: %s',