Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions internal/manage/actions/migrations/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,13 @@ func createMigrationCmd(name, description string, withProgressTracking bool) *co
return fmt.Errorf("executing migration command: %w", err)
}

if withProgressTracking && progressInterval != nil && *progressInterval > 0 && (Running(response) || Finalizing(response)) {
fmt.Println("Progress:")
output, err := GetOutput(response, name)
if err != nil {
return fmt.Errorf("formatting output: %w", err)
}
fmt.Print(output)

if withProgressTracking && progressInterval != nil && *progressInterval > 0 && (Running(response) || Finalizing(response)) {
var stopCondition func(*pb.MigrationsResponse) bool
if name == "finalize" {
stopCondition = func(r *pb.MigrationsResponse) bool { return !Running(r) && !Finalizing(r) }
Expand All @@ -157,12 +161,6 @@ func createMigrationCmd(name, description string, withProgressTracking bool) *co
return TrackMigrationProgress(cl, *progressInterval, stopCondition, printCallback)
}

output, err := GetOutput(response, name)
if err != nil {
return fmt.Errorf("formatting output: %w", err)
}

fmt.Print(output)
return nil
}

Expand Down
Loading