mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-09 18:28:50 +01:00
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
a38abdfd6e
commit
b28878d8d9
1 changed files with 8 additions and 6 deletions
|
|
@ -712,6 +712,10 @@ func RemoveUnusedAssets() (ret []string) {
|
|||
}
|
||||
}
|
||||
|
||||
if !isFileWatcherAvailable() {
|
||||
HandleAssetsRemoveEvent(absPath)
|
||||
}
|
||||
|
||||
if removeErr := filelock.RemoveWithoutFatal(absPath); removeErr != nil {
|
||||
logging.LogErrorf("remove unused asset [%s] failed: %s", absPath, removeErr)
|
||||
util.PushErrMsg(fmt.Sprintf("%s", removeErr), 7000)
|
||||
|
|
@ -719,9 +723,6 @@ func RemoveUnusedAssets() (ret []string) {
|
|||
}
|
||||
|
||||
util.RemoveAssetText(unusedAsset)
|
||||
if !isFileWatcherAvailable() {
|
||||
HandleAssetsRemoveEvent(absPath)
|
||||
}
|
||||
}
|
||||
ret = append(ret, absPath)
|
||||
}
|
||||
|
|
@ -758,6 +759,10 @@ func RemoveUnusedAsset(p string) (ret string) {
|
|||
cache.RemoveAssetHash(hash)
|
||||
}
|
||||
|
||||
if !isFileWatcherAvailable() {
|
||||
HandleAssetsRemoveEvent(absPath)
|
||||
}
|
||||
|
||||
if err = filelock.RemoveWithoutFatal(absPath); err != nil {
|
||||
logging.LogErrorf("remove unused asset [%s] failed: %s", absPath, err)
|
||||
util.PushErrMsg(fmt.Sprintf("%s", err), 7000)
|
||||
|
|
@ -766,9 +771,6 @@ func RemoveUnusedAsset(p string) (ret string) {
|
|||
ret = absPath
|
||||
|
||||
util.RemoveAssetText(p)
|
||||
if !isFileWatcherAvailable() {
|
||||
HandleAssetsRemoveEvent(absPath)
|
||||
}
|
||||
|
||||
IncSync()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue