Improve the image loading performance in the database https://github.com/siyuan-note/siyuan/issues/15245

This commit is contained in:
Daniel 2025-07-09 16:18:53 +08:00
parent 9bb91c3a97
commit c852f6f51a
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
8 changed files with 113 additions and 8 deletions

View file

@ -75,9 +75,9 @@ func watchAssets() {
timer.Reset(time.Millisecond * 100)
if lastEvent.Op&fsnotify.Rename == fsnotify.Rename || lastEvent.Op&fsnotify.Write == fsnotify.Write {
IndexAssetContent(lastEvent.Name)
HandleAssetsChangeEvent(lastEvent.Name)
} else if lastEvent.Op&fsnotify.Remove == fsnotify.Remove {
RemoveIndexAssetContent(lastEvent.Name)
HandleAssetsRemoveEvent(lastEvent.Name)
}
case err, ok := <-assetsWatcher.Errors:
if !ok {
@ -94,9 +94,9 @@ func watchAssets() {
go cache.LoadAssets()
if lastEvent.Op&fsnotify.Remove == fsnotify.Remove {
RemoveIndexAssetContent(lastEvent.Name)
HandleAssetsRemoveEvent(lastEvent.Name)
} else {
IndexAssetContent(lastEvent.Name)
HandleAssetsChangeEvent(lastEvent.Name)
}
}
}