From 47af53443e8aaf130e4001963372ecb13d12c19f Mon Sep 17 00:00:00 2001 From: aixianling Date: Fri, 18 Oct 2024 10:49:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=8B=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=9E=84=E5=BB=BAid=E7=9A=84=E5=BC=82=E5=B8=B8=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/websocket/custom/getZip.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/websocket/custom/getZip.js b/src/websocket/custom/getZip.js index 3e9be60..a50d4c4 100644 --- a/src/websocket/custom/getZip.js +++ b/src/websocket/custom/getZip.js @@ -66,12 +66,13 @@ const handleZip = (id, ws) => { const buildConfig = { web: {task: "devops-web", token: 'fLeOGSVIRs405Me'}, }[info.type] + let currentJob = 1 startUpdateSql() .then(() => progress.set(30, id)) .then(() => fse.emptyDir(dist || `../zips/${deploy}`)) + .then(() => http.get(`/view/devops/job/${buildConfig.task}/api/json`).then(res => currentJob = (res.data?.nextBuildNumber || 1))) .then(() => http.get(`/view/devops/job/${buildConfig.task}/buildWithParameters`, {params: {token: buildConfig.token, pid: id, dist: deploy}})) - .then(() => http.get(`/view/devops/job/${buildConfig.task}/api/json`).then(res => (res.data?.nextBuildNumber - 1) || 1)) - .then(currentJob => new Promise((resolve, reject) => { + .then(() => new Promise((resolve, reject) => { jobs[id] = {task: buildConfig.task, build: currentJob} const timer = setInterval(() => { http.get(`/view/devops/job/${buildConfig.task}/${currentJob}/api/json`).then(res => {