mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-21 19:41:05 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
fe9a128d22
@ -99,7 +99,7 @@ func InitDatabase(forceRebuild bool) (err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if gulu.File.IsExist(util.BlockTreePath) {
|
if gulu.File.IsExist(util.BlockTreePath) {
|
||||||
os.RemoveAll(util.BlockTreePath)
|
treenode.InitBlockTree(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
initDBConnection()
|
initDBConnection()
|
||||||
|
@ -375,7 +375,7 @@ func InitBlockTree(force bool) {
|
|||||||
if force {
|
if force {
|
||||||
err := os.RemoveAll(util.BlockTreePath)
|
err := os.RemoveAll(util.BlockTreePath)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
logging.LogErrorf("remove blocktree file failed: %s", err)
|
logging.LogErrorf("remove block tree file failed: %s", err)
|
||||||
}
|
}
|
||||||
blockTrees = &sync.Map{}
|
blockTrees = &sync.Map{}
|
||||||
return
|
return
|
||||||
@ -456,7 +456,11 @@ func SaveBlockTree(force bool) {
|
|||||||
defer blockTreeLock.Unlock()
|
defer blockTreeLock.Unlock()
|
||||||
|
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
os.MkdirAll(util.BlockTreePath, 0755)
|
if err := os.MkdirAll(util.BlockTreePath, 0755); nil != err {
|
||||||
|
logging.LogErrorf("create block tree dir [%s] failed: %s", util.BlockTreePath, err)
|
||||||
|
os.Exit(logging.ExitCodeFileSysErr)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
size := uint64(0)
|
size := uint64(0)
|
||||||
var count int
|
var count int
|
||||||
|
Loading…
Reference in New Issue
Block a user