From 33e2c78d904e92fcc24602849581b37e8d194330 Mon Sep 17 00:00:00 2001 From: aixianling Date: Thu, 7 Jul 2022 17:47:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E5=88=B6=E9=A1=B9=E7=9B=AE=E6=89=93?= =?UTF-8?q?=E5=8C=85=E6=8E=A5=E5=8F=A3=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rest/custom/getZip.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/rest/custom/getZip.js b/src/rest/custom/getZip.js index f03ca6d..44f35af 100644 --- a/src/rest/custom/getZip.js +++ b/src/rest/custom/getZip.js @@ -10,9 +10,6 @@ module.exports = { let info = res?.[0], sql if (info?.id) { sql = `update node_custom_config set download=null,error=null,zipTime='${dayjs().format("YYYY-MM-DD HH:mm:ss")}' where ${uniCon}` - db.query(sql).then(() => setTimeout(() => { - response.send({code: 0}) - }, 2000)) const buildPath = { web: 'base-web', wxwork: 'base-wxcp', @@ -20,6 +17,12 @@ module.exports = { }[info.type] || {} const path = `/home/deploy/node-service/${buildPath}`, dest = `/home/deploy/node-service/customZips/${id}/` + Promise.all([ + execute(`/root/node-service/update.sh ${info.name} ${path}`), + db.query(sql) + ]).then(() => setTimeout(() => { + response.send({code: 0}) + }, 5000)) execute(`cd ${path}&&npm run apps&&node bin/pages.js ${id}&&npm run build`) .then(() => fse.emptyDir(dest)) .then(() => execute(`/root/node-service/move.sh ${info.type} ${path} ${dest}`))