Skip to content

Commit

Permalink
migrate: add additional info log
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed Dec 2, 2023
1 parent c4db654 commit c1988d7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/migrate/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"os"
"path/filepath"
"sync"
"time"

rhp2 "go.sia.tech/core/rhp/v2"
"go.sia.tech/core/types"
Expand Down Expand Up @@ -167,10 +168,13 @@ func migrateStorageFolders(ctx context.Context, db Store, dir string, destructiv
go func(ctx context.Context, volumeID int64, newPath, oldPath string) {
defer wg.Done()

log.Info("migrating storage data", zap.String("newPath", newPath), zap.String("oldPath", oldPath))
start := time.Now()
err := migrateFolderSectors(ctx, db, volumeID, maxSectors, newPath, oldPath, destructive, log)
if err != nil {
errCh <- fmt.Errorf("failed to migrate storage data %q: %w", oldPath, err)
}
log.Info("finished migrating storage data", zap.String("newPath", newPath), zap.String("oldPath", oldPath), zap.Duration("elapsed", time.Since(start)))
}(ctx, volumeID, newPath, filepath.Join(folder.Path, "siahostdata.dat"))
}

Expand Down

0 comments on commit c1988d7

Please sign in to comment.