mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-09 09:35:03 +09:00
Fasttrack getting all changes
This commit is contained in:
parent
3366ffbfb7
commit
53815df4b6
1 changed files with 8 additions and 1 deletions
|
@ -48,7 +48,14 @@ func (tm *treeMigrator) migrateTreeStorage(ctx context.Context, storage oldstora
|
|||
if err != nil {
|
||||
return fmt.Errorf("migration: failed to get heads: %w", err)
|
||||
}
|
||||
tm.dfs(ctx, heads, rootChange.Id)
|
||||
if iterStore, ok := storage.(oldstorage.ChangesIterator); ok {
|
||||
tm.allChanges, err = iterStore.GetAllChanges()
|
||||
if err != nil {
|
||||
return fmt.Errorf("migration: failed to get all changes: %w", err)
|
||||
}
|
||||
} else {
|
||||
tm.dfs(ctx, heads, rootChange.Id)
|
||||
}
|
||||
newStorage, err := objecttree.CreateStorage(ctx, rootChange, headStorage, store)
|
||||
if err != nil && !errors.Is(err, treestorage.ErrTreeExists) {
|
||||
return fmt.Errorf("migration: failed to create new storage: %w", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue