From ca73a70112a6023c5ac5ac159fbb6787eec06283 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sun, 20 Aug 2023 11:24:11 +0800 Subject: [PATCH] :art: Remove asset content indexes when deleting asset files https://github.com/siyuan-note/siyuan/issues/9010 --- kernel/model/assets_watcher.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/model/assets_watcher.go b/kernel/model/assets_watcher.go index eeb69a5df..937860b8d 100644 --- a/kernel/model/assets_watcher.go +++ b/kernel/model/assets_watcher.go @@ -74,7 +74,7 @@ func watchAssets() { lastEvent = event timer.Reset(time.Millisecond * 100) - if lastEvent.Op&fsnotify.Rename == fsnotify.Rename { + if lastEvent.Op&fsnotify.Rename == fsnotify.Rename || lastEvent.Op&fsnotify.Write == fsnotify.Write { IndexAssetContent(lastEvent.Name) } else if lastEvent.Op&fsnotify.Remove == fsnotify.Remove { RemoveIndexAssetContent(lastEvent.Name) @@ -87,7 +87,6 @@ func watchAssets() { case <-timer.C: //logging.LogInfof("assets changed: %s", lastEvent) if lastEvent.Op&fsnotify.Write == fsnotify.Write { - // 外部修改已有资源文件后纳入云端同步 https://github.com/siyuan-note/siyuan/issues/4694 IncSync() }