From 3d5bce566e444ac57ca513f202aade4189ed65b1 Mon Sep 17 00:00:00 2001 From: aixianling Date: Fri, 18 Oct 2024 10:34:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E7=BB=AD=E6=94=B6=E5=B0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/websocket/custom/getZip.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) 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'