From ffedce4351a09c6cdc4b2355d2bfdc3f5f80f692 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Mon, 12 Sep 2022 15:23:22 +0700 Subject: [PATCH 1/4] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA=D0=B8?= =?UTF-8?q?=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA=20=D1=81=D0=B5=D1=80?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/core/Reader/ReaderWorker.js | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/server/core/Reader/ReaderWorker.js b/server/core/Reader/ReaderWorker.js index 340c4f90..8cd5e63d 100644 --- a/server/core/Reader/ReaderWorker.js +++ b/server/core/Reader/ReaderWorker.js @@ -83,6 +83,7 @@ class ReaderWorker { let convertFilename = ''; const overLoadMes = 'Слишком большая очередь загрузки. Пожалуйста, попробуйте позже.'; + const fileNotFoundMes = 'Файл не найден'; const overLoadErr = new Error(overLoadMes); let q = null; @@ -193,17 +194,24 @@ class ReaderWorker { mes = mes[0]; if (mes == 'abort') mes = overLoadMes; + if (mes.indexOf('ENOTDIR') >= 0) + mes = fileNotFoundMes; + wState.set({state: 'error', error: mes}); } finally { //clean - if (q) - q.ret(); - if (decompDir) - await fs.remove(decompDir); - if (downloadedFilename && !isUploaded) - await fs.remove(downloadedFilename); - if (convertFilename) - await fs.remove(convertFilename); + try { + if (q) + q.ret(); + if (decompDir) + await fs.remove(decompDir); + if (downloadedFilename && !isUploaded) + await fs.remove(downloadedFilename); + if (convertFilename) + await fs.remove(convertFilename); + } catch (e) { + log(LM_ERR, `Remove error: ${e.stack}`); + } } } From b58d3a1b8bf4c354c480c87912828faa992eedca Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Tue, 20 Sep 2022 20:21:41 +0700 Subject: [PATCH 2/4] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=20CopyWebpackPlugin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/webpack.dev.config.js | 2 +- build/webpack.prod.config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/webpack.dev.config.js b/build/webpack.dev.config.js index f27ee9b3..dd2a0b1e 100644 --- a/build/webpack.dev.config.js +++ b/build/webpack.dev.config.js @@ -38,6 +38,6 @@ module.exports = merge(baseWpConfig, { template: `${clientDir}/index.html.template`, filename: `${publicDir}/index.html` }), - new CopyWebpackPlugin({patterns: [{from: `${clientDir}/assets/*`, to: `${publicDir}/`}]}) + new CopyWebpackPlugin({patterns: [{context: `${clientDir}/assets`, from: `${clientDir}/assets/*`, to: `${publicDir}/`}]}) ] }); diff --git a/build/webpack.prod.config.js b/build/webpack.prod.config.js index d67d053f..46f950cc 100644 --- a/build/webpack.prod.config.js +++ b/build/webpack.prod.config.js @@ -54,7 +54,7 @@ module.exports = merge(baseWpConfig, { filename: `${publicDir}/index.html` }), new CopyWebpackPlugin({patterns: - [{from: `${clientDir}/assets/*`, to: `${publicDir}/`, context: `${clientDir}/assets` }] + [{context: `${clientDir}/assets`, from: `${clientDir}/assets/*`, to: `${publicDir}/` }] }), new GenerateSW({ cacheId: 'liberama', From 225230381fef609280d538f66aa3ce825e0c194e Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sat, 1 Oct 2022 13:39:02 +0700 Subject: [PATCH 3/4] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=87=D0=B8=D1=81=D1=82=D0=BA=D0=B0=20output=20?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=20=D1=81=D0=B1=D0=BE=D1=80=D0=BA?= =?UTF-8?q?=D0=BE=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/webpack.base.config.js | 1 + build/webpack.dev.config.js | 3 ++- build/webpack.prod.config.js | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/build/webpack.base.config.js b/build/webpack.base.config.js index 570f9193..a2d6e82d 100644 --- a/build/webpack.base.config.js +++ b/build/webpack.base.config.js @@ -14,6 +14,7 @@ module.exports = { entry: [`${clientDir}/main.js`], output: { publicPath: '/app/', + clean: true }, module: { diff --git a/build/webpack.dev.config.js b/build/webpack.dev.config.js index dd2a0b1e..088f3cf5 100644 --- a/build/webpack.dev.config.js +++ b/build/webpack.dev.config.js @@ -16,7 +16,8 @@ module.exports = merge(baseWpConfig, { devtool: 'inline-source-map', output: { path: `${publicDir}/app`, - filename: 'bundle.js' + filename: 'bundle.js', + clean: true }, module: { diff --git a/build/webpack.prod.config.js b/build/webpack.prod.config.js index 46f950cc..2ee142b2 100644 --- a/build/webpack.prod.config.js +++ b/build/webpack.prod.config.js @@ -18,7 +18,8 @@ module.exports = merge(baseWpConfig, { mode: 'production', output: { path: `${publicDir}/app_new`, - filename: 'bundle.[contenthash].js' + filename: 'bundle.[contenthash].js', + clean: true }, module: { rules: [ From 3fbe6e9d9b149de235295887741cefd6fe3e3f30 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Wed, 5 Oct 2022 15:15:26 +0700 Subject: [PATCH 4/4] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/core/Reader/ReaderWorker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/core/Reader/ReaderWorker.js b/server/core/Reader/ReaderWorker.js index 8cd5e63d..6c81b40f 100644 --- a/server/core/Reader/ReaderWorker.js +++ b/server/core/Reader/ReaderWorker.js @@ -185,11 +185,11 @@ class ReaderWorker { })(); } catch (e) { + log(LM_ERR, `url: ${url}, downloadedFilename: ${downloadedFilename}`); log(LM_ERR, e.stack); let mes = e.message.split('|FORLOG|'); if (mes[1]) log(LM_ERR, mes[0] + mes[1]); - log(LM_ERR, `downloadedFilename: ${downloadedFilename}`); mes = mes[0]; if (mes == 'abort')