mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-22 15:02:23 +00:00
Allow lockfile force to be specified in the request body
This commit is contained in:
parent
d5ddad914e
commit
53ed41a4e2
@ -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?
|
||||||
|
Loading…
Reference in New Issue
Block a user