diff --git a/lib/plugins.js b/lib/plugins.js index fb770557..60390989 100644 --- a/lib/plugins.js +++ b/lib/plugins.js @@ -681,6 +681,7 @@ function sendMessage (rec) { if (pluginType === 'sms') return smsPlugin.sendMessage(rec) throw new Error('No such plugin type: ' + pluginType) }) + return Promise.all(pluginPromises) } exports.sendMessage = sendMessage @@ -729,8 +730,9 @@ function checkNotification () { return sendMessage(rec) }) - .then(() => { - logger.debug('Successfully sent alerts') + .then(results => { + console.log('DEBUG25') + if (results.length > 0) logger.debug('Successfully sent alerts') }) .catch(err => { logger.error(err)