From aa82973598f57edf9f7c93fbbba585f96012fc1c Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Thu, 8 Feb 2018 16:01:22 -0500 Subject: [PATCH] Log update and restart requests --- index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 7070ed5..f706313 100644 --- a/index.js +++ b/index.js @@ -345,8 +345,13 @@ function rSequence (req, res, next) { } function rUpdate (req, res, next) { + log.info(`update`, { time : +new Date() }) exec('sh ./scripts/update.sh', (err, stdio, stderr) => { - res.send({ success : true, action : 'update' }) + if (err) { + log.error(err) + } + log.info(`update`, { git : stdio }) + res.send({ success : true, action : 'update', output : stdio }) res.end() next() setTimeout(() => { @@ -356,6 +361,7 @@ function rUpdate (req, res, next) { } function rRestart (req, res, next) { + log.info(`restart`, { time : +new Date() }) res.send({ success : true, action : 'restart' }) res.end() next()