From df2618ccec0992fbca9186ef84dd7f351faae703 Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Fri, 30 Sep 2016 12:19:00 +0100 Subject: [PATCH] Turned off pushover alerts --- lib/mqtt/mqttClient.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/mqtt/mqttClient.js b/lib/mqtt/mqttClient.js index e3244f6..ebfa33b 100644 --- a/lib/mqtt/mqttClient.js +++ b/lib/mqtt/mqttClient.js @@ -11,14 +11,6 @@ var requestify = require('requestify'); var db = require('../server/db-connector').dbConnection; var dbSave = require('../server/db-save')(db); -var pusher = require('../pusher'); - -//var nano = require('nano')('http://martind2000:1V3D4m526i@localhost:5984'); -/* - var nano = require('nano')('http://localhost:5984'); - var db_name = 'mqttarchive'; - var dbCouch = nano.use(db_name); - */ //let remoteHost = process.env.NODE_ENV === 'production' ? 'http://mdotserver.mybluemix.net/apiv2/message' : 'http://localhost:3011/apiv2/message'; const remoteHost = process.env.NODE_ENV === 'production' ? 'http://ec2-52-211-111-57.eu-west-1.compute.amazonaws.com/apiv2/message' : 'http://localhost:3011/apiv2/message'; @@ -95,8 +87,7 @@ var watchDogTimeout = () => { 'Watchdog timeout. Message has not been received for over 20 minutes.'); logger.warn('Last received:' + lastReceived + 'Now:' + now); - pusher.push( - 'Watchdog timeout. Message has not been received for over 20 Minutes. \n\nLast received:' + lastReceived + 'Now:' + now); + wdTimedOut = true; }; @@ -131,7 +122,6 @@ var mqttClient = function() { // connected = true; logger.info('Connected to ', address); - pusher.push('Connected to ' + address); clearTimeout(watchDog); watchDog = setTimeout(watchDogTimeout, 1200000); lastReceived = new Date(); @@ -188,7 +178,7 @@ var mqttClient = function() { var now = new Date(); var s = 'Receiving again :::\n\nLast received: ' + lastReceived + 'Now: ' + now + "\n\n" + message.toString(); logger.warn(s); - pusher.push(s); + wdTimedOut = false; } lastReceived = new Date(); @@ -205,7 +195,7 @@ var mqttClient = function() { this.getCount = function() { 'use strict'; return count; - } + }; };