mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 12:39:49 +08:00
chore: retry upload add delay (#50302)
This commit is contained in:
parent
3f3999cd1b
commit
05083493b0
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user