diff --git a/app/model/StoreModel.js b/app/model/StoreModel.js index 6f654bb..8d62bf0 100644 --- a/app/model/StoreModel.js +++ b/app/model/StoreModel.js @@ -22,9 +22,13 @@ function storeResource(path, url) { return new Promise((resolve, reject) => { mkdirsSync(_path.dirname(path)); const writeableStream = fs.createWriteStream(path); - request.get({ url: url, timeout: 20000 }).pipe(writeableStream).on('close', () => { - resolve(true); - }); + try { + request.get({ url: url, timeout: 20000 }).pipe(writeableStream).on('close', () => { + resolve(true); + }); + }catch(err) { + console.log(err); + } }); } diff --git a/html/index.html b/html/index.html index 43b52c5..e2b9c7b 100644 --- a/html/index.html +++ b/html/index.html @@ -130,7 +130,7 @@ let server_url = document.location.hostname == '' ? 'http://localhost:5750' : `http://${document.location.hostname}:5750`; const ajax = axios.create({ baseURL: server_url, - timeout: 20000, + timeout: 30000, headers: { 'Content-Type': 'application/x-www-form-urlencoded', //'Access-Control-Allow-Origin': true