Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: 重构关闭笔记本

Liang Ding0f82fb3fce65
diff --git a/kernel/model/mount.go b/kernel/model/mount.go
index ec895d5f1a..e3ac12ef8b 100644
--- a/kernel/model/mount.go
+++ b/kernel/model/mount.go
@@ -123,16 +123,16 @@ func Unmount(boxID string) {
}
func unmount0(boxID string) {
- for _, box := range Conf.GetOpenedBoxes() {
- if box.ID == boxID {
- boxConf := box.GetConf()
- boxConf.Closed = true
- box.SaveConf(boxConf)
- box.Unindex()
- debug.FreeOSMemory()
- return
- }
+ box := Conf.Box(boxID)
+ if nil == box {
+ return
}
+
+ boxConf := box.GetConf()
+ boxConf.Closed = true
+ box.SaveConf(boxConf)
+ box.Unindex()
+ debug.FreeOSMemory()
}
func Mount(boxID string) (alreadyMount bool, err error) {