From 2742fc369b82ef16426fb383071dd53838c75450 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Fri, 22 Dec 2023 23:37:54 +0800 Subject: [PATCH] :art: Improve remove workspace dir path https://ld246.com/article/1703151906396 --- kernel/api/workspace.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel/api/workspace.go b/kernel/api/workspace.go index aada5d169..bf489e25b 100644 --- a/kernel/api/workspace.go +++ b/kernel/api/workspace.go @@ -138,8 +138,11 @@ func removeWorkspaceDir(c *gin.Context) { path := arg["path"].(string) - if util.IsWorkspaceLocked(path) { - logging.LogWarnf("skip remove workspace [%s] because it is locked", path) + if util.IsWorkspaceLocked(path) || util.WorkspaceDir == path { + msg := "Cannot remove current workspace" + ret.Code = -1 + ret.Msg = msg + ret.Data = map[string]interface{}{"closeTimeout": 3000} return }