优化代码
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const db = require("../../utils/dbUitls");
|
||||
const dayjs = require("dayjs")
|
||||
const execute = require("../../tools/exec");
|
||||
const fse = require("fs-extra");
|
||||
module.exports = {
|
||||
action: "/node/autodeploy/getZip",
|
||||
method: "post",
|
||||
@@ -11,7 +12,9 @@ module.exports = {
|
||||
let info = res?.[0]
|
||||
if (info?.id) {
|
||||
db.query(`update node_autodeploy set download=null,error=null where id='${info.id}'`).then(() => {
|
||||
setTimeout(() => response.send({code: 0}), 2000)
|
||||
fse.emptydir(info.target, () => {
|
||||
response.send({code: 0})
|
||||
})
|
||||
})
|
||||
execute(`${info.updateShell}`).then(() => execute(`${info.libShell}`))
|
||||
.then(() => {
|
||||
|
||||
Reference in New Issue
Block a user