This commit is contained in:
Liang Ding 2022-10-01 12:03:22 +08:00
parent ae8ce006ba
commit a772b47287
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
6 changed files with 36 additions and 11 deletions

View file

@ -997,6 +997,8 @@ func (tx *Transaction) begin() (err error) {
func (tx *Transaction) commit() (err error) {
for _, tree := range tx.trees {
go pushTreeStat(tree)
if err = writeJSONQueue(tree); nil != err {
return
}
@ -1007,6 +1009,11 @@ func (tx *Transaction) commit() (err error) {
return
}
func pushTreeStat(tree *parse.Tree) {
runeCount, wordCount := treenode.TreeStat(tree)
util.PushStatusBarCounter(runeCount, wordCount)
}
func (tx *Transaction) rollback() {
tx.trees, tx.nodes = nil, nil
return