🎨 Improve data synchronization to reduce the probability of conflicts https://github.com/siyuan-note/siyuan/issues/13065
This commit is contained in:
parent
a32ceb8e2f
commit
2da780a04e
1 changed files with 3 additions and 0 deletions
|
@ -645,6 +645,7 @@ func checkoutRepo(id string) {
|
|||
|
||||
// 回滚快照时默认为当前数据创建一个快照
|
||||
// When rolling back a snapshot, a snapshot is created for the current data by default https://github.com/siyuan-note/siyuan/issues/12470
|
||||
FlushTxQueue()
|
||||
_, err = repo.Index("Backup before checkout", map[string]interface{}{eventbus.CtxPushMsg: eventbus.CtxPushMsgToStatusBarAndProgress})
|
||||
if err != nil {
|
||||
logging.LogErrorf("index repository failed: %s", err)
|
||||
|
@ -1627,7 +1628,9 @@ var promotedPurgeDataRepo bool
|
|||
|
||||
func indexRepoBeforeCloudSync(repo *dejavu.Repo) (beforeIndex, afterIndex *entity.Index, err error) {
|
||||
start := time.Now()
|
||||
|
||||
beforeIndex, _ = repo.Latest()
|
||||
FlushTxQueue()
|
||||
afterIndex, err = repo.Index("[Sync] Cloud sync", map[string]interface{}{
|
||||
eventbus.CtxPushMsg: eventbus.CtxPushMsgToStatusBar,
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue