1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-07 21:47:02 +09:00

Add id to remove func

This commit is contained in:
Mikhail Rakhmanov 2025-05-05 13:47:19 +02:00
parent 23fb5629b9
commit ba90a57c7d
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B

View file

@ -34,7 +34,7 @@ type Progress interface {
AddDone(done int64)
}
type RemoveFunc func(newStorage spacestorage.SpaceStorage, rootPath string) error
type RemoveFunc func(newStorage spacestorage.SpaceStorage, id, rootPath string) error
type spaceMigrator struct {
oldProvider oldstorage.SpaceStorageProvider
@ -60,11 +60,9 @@ func (s *spaceMigrator) MigrateId(ctx context.Context, id string, progress Progr
storage.Close(ctx)
return ErrAlreadyMigrated
}
if !migrated {
err := s.removeFunc(storage, s.rootPath)
if err != nil {
return fmt.Errorf("migration: failed to remove new storage: %w", err)
}
err := s.removeFunc(storage, id, s.rootPath)
if err != nil {
return fmt.Errorf("migration: failed to remove new storage: %w", err)
}
oldStorage, err := s.oldProvider.WaitSpaceStorage(ctx, id)
if err != nil {