From b871c710b261a0edc0b9941fc7bde246ddf89636 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Tue, 25 Mar 2025 17:27:34 +0800 Subject: [PATCH] fix(file): fix issue with download process not work (#8237) --- agent/app/api/v2/file.go | 3 --- agent/utils/websocket/process_data.go | 3 +++ frontend/src/views/toolbox/supervisor/file/index.vue | 10 +++++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/agent/app/api/v2/file.go b/agent/app/api/v2/file.go index f4e27a76b..f05e27b1e 100644 --- a/agent/app/api/v2/file.go +++ b/agent/app/api/v2/file.go @@ -789,9 +789,6 @@ func (b *BaseApi) ProcessKeys(c *gin.Context) { continue } res.Keys = append(res.Keys, key) - if process.Percent == 100 { - global.CACHE.Del(key) - } } helper.SuccessWithData(c, res) } diff --git a/agent/utils/websocket/process_data.go b/agent/utils/websocket/process_data.go index 6e470e8c3..11531e107 100644 --- a/agent/utils/websocket/process_data.go +++ b/agent/utils/websocket/process_data.go @@ -142,6 +142,9 @@ func getDownloadProcess(progress DownloadProgress) (res []byte, err error) { downloadProcess := &files.Process{} _ = json.Unmarshal([]byte(value), downloadProcess) result = append(result, *downloadProcess) + if downloadProcess.Percent == 100 { + global.CACHE.Del(k) + } } res, err = json.Marshal(result) return diff --git a/frontend/src/views/toolbox/supervisor/file/index.vue b/frontend/src/views/toolbox/supervisor/file/index.vue index b96103810..955c29af3 100644 --- a/frontend/src/views/toolbox/supervisor/file/index.vue +++ b/frontend/src/views/toolbox/supervisor/file/index.vue @@ -1,5 +1,11 @@