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}`))