End response and call next() before restarting process.
This commit is contained in:
parent
64343bfc0b
commit
9c0ca37481
6
index.js
6
index.js
|
@ -348,14 +348,20 @@ function rUpdate (req, res, next) {
|
||||||
exec('sh ./scripts/update.sh', (err, stdio, stderr) => {
|
exec('sh ./scripts/update.sh', (err, stdio, stderr) => {
|
||||||
res.send({ success : true, action : 'update' })
|
res.send({ success : true, action : 'update' })
|
||||||
res.end()
|
res.end()
|
||||||
|
next()
|
||||||
|
setTimeout(() => {
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
|
}, 100)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function rRestart (req, res, next) {
|
function rRestart (req, res, next) {
|
||||||
res.send({ success : true, action : 'restart' })
|
res.send({ success : true, action : 'restart' })
|
||||||
res.end()
|
res.end()
|
||||||
|
next()
|
||||||
|
setTimeout(() => {
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
|
}, 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Ble functions
|
//Ble functions
|
||||||
|
|
Loading…
Reference in New Issue