mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10:12 +01:00
🎨 改进打开虚拟引用后加载文档的性能 https://github.com/siyuan-note/siyuan/issues/7378
This commit is contained in:
parent
7d05f4e8c7
commit
e89f706864
5 changed files with 9 additions and 16 deletions
|
|
@ -67,7 +67,7 @@ func InitDatabase(forceRebuild bool) (err error) {
|
|||
initDatabaseLock.Lock()
|
||||
defer initDatabaseLock.Unlock()
|
||||
|
||||
ClearBlockCache()
|
||||
ClearCache()
|
||||
disableCache()
|
||||
defer enableCache()
|
||||
|
||||
|
|
@ -888,7 +888,7 @@ func deleteBlocksByBoxTx(tx *sql.Tx, box string) (err error) {
|
|||
if err = execStmtTx(tx, stmt, box); nil != err {
|
||||
return
|
||||
}
|
||||
ClearBlockCache()
|
||||
ClearCache()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -1012,7 +1012,7 @@ func deleteByRootID(tx *sql.Tx, rootID string, context map[string]interface{}) (
|
|||
if err = execStmtTx(tx, stmt, rootID); nil != err {
|
||||
return
|
||||
}
|
||||
ClearBlockCache()
|
||||
ClearCache()
|
||||
eventbus.Publish(eventbus.EvtSQLDeleteBlocks, context, rootID)
|
||||
return
|
||||
}
|
||||
|
|
@ -1048,7 +1048,7 @@ func batchDeleteByRootIDs(tx *sql.Tx, rootIDs []string, context map[string]inter
|
|||
if err = execStmtTx(tx, stmt); nil != err {
|
||||
return
|
||||
}
|
||||
ClearBlockCache()
|
||||
ClearCache()
|
||||
eventbus.Publish(eventbus.EvtSQLDeleteBlocks, context, fmt.Sprintf("%d", len(rootIDs)))
|
||||
return
|
||||
}
|
||||
|
|
@ -1082,7 +1082,7 @@ func batchDeleteByPathPrefix(tx *sql.Tx, boxID, pathPrefix string) (err error) {
|
|||
if err = execStmtTx(tx, stmt, boxID, pathPrefix+"%"); nil != err {
|
||||
return
|
||||
}
|
||||
ClearBlockCache()
|
||||
ClearCache()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -1099,7 +1099,7 @@ func batchUpdateHPath(tx *sql.Tx, boxID, rootID, oldHPath, newHPath string) (err
|
|||
if err = execStmtTx(tx, stmt, newHPath, boxID, rootID, oldHPath); nil != err {
|
||||
return
|
||||
}
|
||||
ClearBlockCache()
|
||||
ClearCache()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue