🐛 Uninstalling plugins, widgets and templates may cause data sync errors https://github.com/siyuan-note/siyuan/issues/10324

This commit is contained in:
Daniel 2024-02-06 14:23:17 +08:00
parent fe9e261feb
commit 745c9bcf99
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
7 changed files with 14 additions and 12 deletions

View file

@ -1,7 +1,6 @@
package model
import (
"os"
"path/filepath"
"runtime/debug"
"strings"
@ -128,7 +127,7 @@ func LoadAssetsTexts() {
util.AssetsTextsLock.Lock()
if err = gulu.JSON.UnmarshalJSON(data, &util.AssetsTexts); nil != err {
logging.LogErrorf("unmarshal assets texts failed: %s", err)
if err = os.RemoveAll(assetsTextsPath); nil != err {
if err = filelock.Remove(assetsTextsPath); nil != err {
logging.LogErrorf("removed corrupted assets texts failed: %s", err)
}
return