@@ -560,20 +560,17 @@ func (p *AppPushOperation) findSpace(ctx context.Context, orgGUID string) (*reso
560560}
561561
562562func (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