Skip to content

Commit 76a5917

Browse files
authored
Merge pull request #497 from datev/feature/blue-green-update
removing not needed loop
2 parents 192bd58 + 84e3e21 commit 76a5917

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

operation/push.go

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -560,20 +560,17 @@ func (p *AppPushOperation) findSpace(ctx context.Context, orgGUID string) (*reso
560560
}
561561

562562
func (p *AppPushOperation) waitForAppHealthy(ctx context.Context, app *resource.App, pollOptions *client.PollingOptions) error {
563-
564563
appPollErr := client.PollForStateOrTimeout(func() (string, string, error) {
565-
for {
566-
procData, err := p.client.Processes.GetStatsForApp(ctx, app.GUID, "web")
567-
if err != nil {
568-
return "FAILED", "Failed to get processes stats for application", err
569-
}
570-
for _, proc := range procData.Stats {
571-
if proc.State != "RUNNING" {
572-
return proc.State, "One or more instances are not running", nil
573-
}
564+
procData, err := p.client.Processes.GetStatsForApp(ctx, app.GUID, "web")
565+
if err != nil {
566+
return "FAILED", "Failed to get processes stats for application", err
567+
}
568+
for _, proc := range procData.Stats {
569+
if proc.State != "RUNNING" {
570+
return proc.State, "One or more instances are not running", nil
574571
}
575-
return "RUNNING", "", nil
576572
}
573+
return "RUNNING", "", nil
577574
}, "RUNNING", pollOptions)
578575
return appPollErr
579576
}

0 commit comments

Comments
 (0)