feat: add sync checkpoint restore for last successful sync
Capture rolling online DB snapshots after push/drain/reconcile and expose SyncPage 数据恢复 plus checkpoint/restore APIs; mark Z12h and restore done in coop docs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -120,6 +120,7 @@ func (m *Manager) loop(ctx context.Context, id string) {
|
||||
now := time.Now().UTC()
|
||||
c.LastReconcileAt = &now
|
||||
})
|
||||
ScheduleCheckpoint(m.store, ch, "reconcile")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -176,6 +177,10 @@ func (m *Manager) tick(ctx context.Context, ch *Channel) error {
|
||||
c.LastError = ""
|
||||
}
|
||||
})
|
||||
// 成功且本批有变更 → 防抖打线上库快照(数据恢复)
|
||||
if err == nil && n > 0 {
|
||||
ScheduleCheckpoint(m.store, ch, "drain")
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user