mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-04 02:41:46 +08:00
🎨 Automatically loads and indexes from the file system when a block is not found https://github.com/siyuan-note/siyuan/issues/10772
This commit is contained in:
parent
b3d581718b
commit
50eef7d1e6
@ -181,6 +181,7 @@ func searchTreeInFilesystem(rootID string) {
|
||||
msdID := util.PushMsg(Conf.language(45), 7000)
|
||||
defer util.PushClearMsg(msdID)
|
||||
|
||||
logging.LogWarnf("searching tree on filesystem [rootID=%s]", rootID)
|
||||
var treePath string
|
||||
filepath.Walk(util.DataDir, func(path string, info fs.FileInfo, err error) error {
|
||||
if info.IsDir() {
|
||||
@ -204,6 +205,7 @@ func searchTreeInFilesystem(rootID string) {
|
||||
})
|
||||
|
||||
if "" == treePath {
|
||||
logging.LogErrorf("tree not found on filesystem [rootID=%s]", rootID)
|
||||
return
|
||||
}
|
||||
|
||||
@ -224,4 +226,5 @@ func searchTreeInFilesystem(rootID string) {
|
||||
treenode.IndexBlockTree(tree)
|
||||
sql.IndexTreeQueue(tree)
|
||||
sql.WaitForWritingDatabase()
|
||||
logging.LogInfof("reindexed tree by filesystem [rootID=%s]", rootID)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user