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