Skip to content

Commit e206680

Browse files
committed
fix: restart running app on push
1 parent a6f0718 commit e206680

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

operation/push.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ func (p *AppPushOperation) pushApp(ctx context.Context, space *resource.Space, m
305305
if err != nil {
306306
return nil, err
307307
}
308+
appWasStarted := app.State == "STARTED"
308309

309310
var pkg *resource.Package
310311
// Check if lifecycle is explicitly set in manifest
@@ -342,9 +343,11 @@ func (p *AppPushOperation) pushApp(ctx context.Context, space *resource.Space, m
342343

343344
if p.stopped {
344345
return p.client.Applications.Stop(ctx, app.GUID)
345-
} else {
346-
return p.client.Applications.Start(ctx, app.GUID)
347346
}
347+
if appWasStarted {
348+
return p.client.Applications.Restart(ctx, app.GUID)
349+
}
350+
return p.client.Applications.Start(ctx, app.GUID)
348351
}
349352

350353
func (p *AppPushOperation) applySpaceManifest(ctx context.Context, space *resource.Space, manifest *AppManifest) error {

0 commit comments

Comments
 (0)