blob: c87d21b6becfa43b0b925badf37c54590db82053 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
module.exports = restart
var lifecycle = require("./utils/lifecycle")
, stop = lifecycle.cmd("stop")
, start = lifecycle.cmd("start")
, restartCmd = lifecycle.cmd("restart", true)
, log = require("./utils/log")
function restart (args, cb) {
restartCmd(args, function (er) {
if (!er) return cb()
if (er.message !== "Nothing to do") return cb(er)
stop(args, function (er) {
if (er) return log.er(cb, "Failed to stop")(er)
start(args, cb)
})
})
}
|