mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
⚡ Improve the image loading performance in the database https://github.com/siyuan-note/siyuan/issues/15245
This commit is contained in:
parent
9bb91c3a97
commit
c852f6f51a
8 changed files with 113 additions and 8 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue