mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
♻️ Refactor the blocktree storage https://github.com/siyuan-note/siyuan/issues/11773
This commit is contained in:
parent
32413fa11c
commit
7a3d4a05ad
22 changed files with 453 additions and 497 deletions
|
|
@ -82,6 +82,7 @@ func InitDatabase(forceRebuild bool) (err error) {
|
|||
}
|
||||
|
||||
initDBConnection()
|
||||
treenode.InitBlockTree(forceRebuild)
|
||||
|
||||
if !forceRebuild {
|
||||
// 检查数据库结构版本,如果版本不一致的话说明改过表结构,需要重建
|
||||
|
|
@ -101,9 +102,6 @@ func InitDatabase(forceRebuild bool) (err error) {
|
|||
err = nil
|
||||
}
|
||||
}
|
||||
if gulu.File.IsExist(util.BlockTreePath) {
|
||||
treenode.InitBlockTree(true)
|
||||
}
|
||||
|
||||
initDBConnection()
|
||||
initDBTables()
|
||||
|
|
@ -1278,6 +1276,11 @@ func CloseDatabase() {
|
|||
logging.LogErrorf("close history database failed: %s", err)
|
||||
return
|
||||
}
|
||||
if err := assetContentDB.Close(); nil != err {
|
||||
logging.LogErrorf("close asset content database failed: %s", err)
|
||||
return
|
||||
}
|
||||
treenode.CloseDatabase()
|
||||
logging.LogInfof("closed database")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue