Skip to content

Commit

Permalink
fix(action): show accurate progress in WatchOverallProgress (#281)
Browse files Browse the repository at this point in the history
The progress was updated incorrectly and only over showed 0 or 1/len(actions).
  • Loading branch information
apricote committed Jul 3, 2023
1 parent faf227d commit cae9e57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hcloud/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (c *ActionClient) WatchOverallProgress(ctx context.Context, actions []*Acti
continue
case ActionStatusSuccess:
delete(watchIDs, a.ID)
successIDs := append(successIDs, a.ID)
successIDs = append(successIDs, a.ID)
sendProgress(progressCh, int(float64(len(actions)-len(successIDs))/float64(len(actions))*100))
case ActionStatusError:
delete(watchIDs, a.ID)
Expand Down

0 comments on commit cae9e57

Please sign in to comment.