From e8a065beac6ee17e21ce85408ab0f0042d8f6d12 Mon Sep 17 00:00:00 2001 From: aixianling Date: Wed, 18 Jan 2023 14:33:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E8=B7=9F=E8=B8=AA=E7=BB=86?= =?UTF-8?q?=E7=B2=92=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/websocket/custom/getZip.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/websocket/custom/getZip.js b/src/websocket/custom/getZip.js index 6934d18..140665a 100644 --- a/src/websocket/custom/getZip.js +++ b/src/websocket/custom/getZip.js @@ -15,12 +15,12 @@ const handleZip = (id, ws) => { wxwork: 'base-wxcp', mp: 'dvcp_v2_wxmp' }[info.type] || {} - let path = `../${buildPath}`, {dist} = info, progress + let path = `../${buildPath}`, {dist} = info, progress = 30 dist = dist || `../zips/${info.name}v${info.version || "1.0.0"}` Promise.all([ db.query(`update node_custom_config set download=null,error=null,zipTime='${dayjs().format("YYYY-MM-DD HH:mm:ss")}' where ${uniCon}`), process.new(`./shell/update.sh ${info.name} ${path}`)]) - .then(() => progress = 30, sendMessage({code: 0, progress})) + .then(() => sendMessage({code: 0, progress})) .then(() => pid = new process(`cd ${path}&&npm run apps&&node bin/pages.js ${id}&&npm run build`), () => sendMessage({code: 0, progress: ++progress})) .then(() => pid.ins()) .then(() => fse.emptyDir(dist)) @@ -53,9 +53,9 @@ module.exports = { if (res?.data) { const data = JSON.parse(res.data) if (data.cid == id) { - pid.kill() + pid.unref() } else if (id == data.id) { - pid.kill() + pid.unref() handleZip(id, ws) } }