mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-04 20:00:17 +01:00
♻️ Improve transaction flush
This commit is contained in:
parent
72d1a059ac
commit
8dd0629b9c
23 changed files with 69 additions and 82 deletions
|
|
@ -45,7 +45,7 @@ func CreateBox(name string) (id string, err error) {
|
|||
name = Conf.language(105)
|
||||
}
|
||||
|
||||
WaitForWritingFiles()
|
||||
FlushTxQueue()
|
||||
|
||||
createDocLock.Lock()
|
||||
defer createDocLock.Unlock()
|
||||
|
|
@ -106,7 +106,7 @@ func RemoveBox(boxID string) (err error) {
|
|||
return errors.New(fmt.Sprintf("can not remove [%s] caused by it is a reserved file", boxID))
|
||||
}
|
||||
|
||||
WaitForWritingFiles()
|
||||
FlushTxQueue()
|
||||
isUserGuide := IsUserGuide(boxID)
|
||||
createDocLock.Lock()
|
||||
defer createDocLock.Unlock()
|
||||
|
|
@ -147,7 +147,7 @@ func RemoveBox(boxID string) (err error) {
|
|||
}
|
||||
|
||||
func Unmount(boxID string) {
|
||||
WaitForWritingFiles()
|
||||
FlushTxQueue()
|
||||
|
||||
unmount0(boxID)
|
||||
evt := util.NewCmdResult("unmount", 0, util.PushModeBroadcast)
|
||||
|
|
@ -178,7 +178,7 @@ func Mount(boxID string) (alreadyMount bool, err error) {
|
|||
boxLock.Store(boxID, true)
|
||||
defer boxLock.Delete(boxID)
|
||||
|
||||
WaitForWritingFiles()
|
||||
FlushTxQueue()
|
||||
isUserGuide := IsUserGuide(boxID)
|
||||
|
||||
localPath := filepath.Join(util.DataDir, boxID)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue