打包失败优化

This commit is contained in:
aixianling
2022-04-01 17:01:56 +08:00
parent 1f0bf4cf73
commit d7b3b041bb
2 changed files with 4 additions and 2 deletions

View File

@@ -8,7 +8,8 @@ module.exports = {
dbUtils.query(sql).then(res => {
let info = res?.[0]
if (info?.id) {
fse.pathExists(`zips/${info.id}/dist`, (err, exists) => {
if (info.err) response.send({code: 1, err: info.err})
else fse.pathExists(`zips/${info.id}/dist`, (err, exists) => {
console.log(`zips/${info.id}/dist=========>${exists}`)
response.send({code: 0, data: exists})
})

View File

@@ -12,8 +12,9 @@ module.exports = {
response.send({code: 0})
}, 2000)
zip(info).then(() => {
db.query(`update node_autodeploy set download='${new Date()}' where id='${info.id}'`)
db.query(`update node_autodeploy set download='${new Date()}',error='' where id='${info.id}'`)
}).catch(err => {
db.query(`update node_autodeploy set error='${err}' where id='${info.id}'`)
console.log(err)
})
} else response.send({code: 1, err: "无法找到git信息"})