mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 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
|
// 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})
|
_, err = repo.Index("Backup before checkout", map[string]interface{}{eventbus.CtxPushMsg: eventbus.CtxPushMsgToStatusBarAndProgress})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logging.LogErrorf("index repository failed: %s", err)
|
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) {
|
func indexRepoBeforeCloudSync(repo *dejavu.Repo) (beforeIndex, afterIndex *entity.Index, err error) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
|
|
||||||
beforeIndex, _ = repo.Latest()
|
beforeIndex, _ = repo.Latest()
|
||||||
|
FlushTxQueue()
|
||||||
afterIndex, err = repo.Index("[Sync] Cloud sync", map[string]interface{}{
|
afterIndex, err = repo.Index("[Sync] Cloud sync", map[string]interface{}{
|
||||||
eventbus.CtxPushMsg: eventbus.CtxPushMsgToStatusBar,
|
eventbus.CtxPushMsg: eventbus.CtxPushMsgToStatusBar,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue