@wildberries/service-cdn-uploader
Advanced tools
Comparing version 2.0.2 to 2.0.3
11
index.js
@@ -56,2 +56,9 @@ /* eslint-disable import/no-unresolved */ | ||
const timeoutSleep = ms => | ||
new Promise((res, rej) => { | ||
setTimeout(() => { | ||
rej(new Error('Timeout')); | ||
}, ms); | ||
}); | ||
const fetchFile = async params => { | ||
@@ -68,2 +75,4 @@ const { | ||
try { | ||
console.log(`File ${fileName} start uploading to ${filePath}`.yellow); | ||
const formData = new FormData(); | ||
@@ -108,3 +117,3 @@ const task = { | ||
try { | ||
await request(params); | ||
await Promise.race([request(params), timeoutSleep(2000)]); | ||
} catch (error) { | ||
@@ -111,0 +120,0 @@ console.log(`Request error ${error}`.red.underline); |
{ | ||
"name": "@wildberries/service-cdn-uploader", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"main": "./index.js", | ||
@@ -66,2 +66,2 @@ "scripts": { | ||
"bin": "index.js" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
7551
3
146