In /v1/apps/:appId/stop, wait for the service to exit before responding

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
This commit is contained in:
Pablo Carranza Velez 2018-03-16 15:13:15 -03:00
parent ad35375994
commit 91ac11d0e8

View File

@ -127,7 +127,7 @@ createApplicationManagerRouter = (applications) ->
if app.services.length > 1
return res.status(400).send('Some v1 endpoints are only allowed on single-container apps')
applications.setTargetVolatileForService(service.imageId, running: action != 'stop')
applications.executeStepAction(serviceAction(action, service.serviceId, service, service), { force })
applications.executeStepAction(serviceAction(action, service.serviceId, service, service, { wait: true }), { force })
.then ->
if action == 'stop'
return service