diff --git a/src/websocket/custom/getZip.js b/src/websocket/custom/getZip.js index c1797ac..3e9be60 100644 --- a/src/websocket/custom/getZip.js +++ b/src/websocket/custom/getZip.js @@ -77,7 +77,8 @@ const handleZip = (id, ws) => { http.get(`/view/devops/job/${buildConfig.task}/${currentJob}/api/json`).then(res => { if (['SUCCESS', 'UNSTABLE'].includes(res.data.result)) { clearInterval(timer) - resolve(endUpdateSql()) + progress.set(90, id) + endUpdateSql().then(resolve) } else if (res.data.result == 'ABORTED') { clearInterval(timer) reject("构建取消") @@ -86,15 +87,18 @@ const handleZip = (id, ws) => { reject("构建失败") } }) - }, 1000) - })).catch(err => { - console.log(err) - const msg = `执行失败:${err.cmd || err}` - return errorUpdateSql(msg) - .then(() => db.detail({table: "node_custom_config", id})) - .then(row => progress.stop(row)) - .catch(() => 0) - }) + }, 2000) + })) + .then(() => db.detail({table: "node_custom_config", id})) + .then(row => progress.finish(row)) + .catch(err => { + console.log(err) + const msg = `执行失败:${err.cmd || err}` + return errorUpdateSql(msg) + .then(() => db.detail({table: "node_custom_config", id})) + .then(row => progress.stop(row)) + .catch(() => 0) + }) } else { const buildPath = { web: 'base-web', wxwork: 'base-wxcp', mp: 'dvcp_v2_wxmp'