增加等待时长
parent
ba87c5e4b6
commit
36d47d3d0c
|
@ -22,9 +22,13 @@ function storeResource(path, url) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
mkdirsSync(_path.dirname(path));
|
mkdirsSync(_path.dirname(path));
|
||||||
const writeableStream = fs.createWriteStream(path);
|
const writeableStream = fs.createWriteStream(path);
|
||||||
request.get({ url: url, timeout: 20000 }).pipe(writeableStream).on('close', () => {
|
try {
|
||||||
resolve(true);
|
request.get({ url: url, timeout: 20000 }).pipe(writeableStream).on('close', () => {
|
||||||
});
|
resolve(true);
|
||||||
|
});
|
||||||
|
}catch(err) {
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@
|
||||||
let server_url = document.location.hostname == '' ? 'http://localhost:5750' : `http://${document.location.hostname}:5750`;
|
let server_url = document.location.hostname == '' ? 'http://localhost:5750' : `http://${document.location.hostname}:5750`;
|
||||||
const ajax = axios.create({
|
const ajax = axios.create({
|
||||||
baseURL: server_url,
|
baseURL: server_url,
|
||||||
timeout: 20000,
|
timeout: 30000,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
//'Access-Control-Allow-Origin': true
|
//'Access-Control-Allow-Origin': true
|
||||||
|
|
Loading…
Reference in New Issue