Allow lockfile force to be specified in the request body

This commit is contained in:
Pablo Carranza Vélez 2015-09-08 15:38:38 +00:00
parent d5ddad914e
commit 53ed41a4e2

View File

@ -94,10 +94,11 @@ module.exports = (secret) ->
api.post '/v1/restart', (req, res) -> api.post '/v1/restart', (req, res) ->
appId = req.body.appId appId = req.body.appId
force = req.body.force
utils.mixpanelTrack('Restart container', appId) utils.mixpanelTrack('Restart container', appId)
if !appId? if !appId?
return res.status(400).send('Missing app id') return res.status(400).send('Missing app id')
Promise.using application.lockUpdates(appId, true), -> Promise.using application.lockUpdates(appId, force), ->
knex('app').select().where({ appId }) knex('app').select().where({ appId })
.then ([ app ]) -> .then ([ app ]) ->
if !app? if !app?