From b193685b414a9cc03a54f576c162d38fe1634910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Mon, 4 Jan 2016 14:47:57 -0300 Subject: [PATCH] refactor --- lib/pushnotificationsservice.js | 12 ++++++------ pushnotificationsservice/pushnotificationsservice.js | 6 +++--- start.sh | 2 +- stop.sh | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/pushnotificationsservice.js b/lib/pushnotificationsservice.js index 61f9bc3..9990bc1 100644 --- a/lib/pushnotificationsservice.js +++ b/lib/pushnotificationsservice.js @@ -19,7 +19,7 @@ var BlockchainExplorer = require('./blockchainexplorer'); var Model = require('./model'); -var PUSHNOTIFICATION_TYPES = { +var PUSHNOTIFICATIONS_TYPES = { 'NewCopayer': { filename: 'new_copayer', notifyDoer: false, @@ -46,9 +46,9 @@ var PUSHNOTIFICATION_TYPES = { }, }; -function PushNotificationService() {}; +function PushNotificationsService() {}; -PushNotificationService.prototype.start = function(opts, cb) { +PushNotificationsService.prototype.start = function(opts, cb) { var self = this; async.parallel([ function(done) { @@ -64,9 +64,9 @@ PushNotificationService.prototype.start = function(opts, cb) { }); }; -PushNotificationService.prototype.sendPushNotification = function(notification, cb) { +PushNotificationsService.prototype.sendPushNotifications = function(notification, cb) { console.log(notification); - if (PUSHNOTIFICATION_TYPES[notification.type] == notification.type) { + if (PUSHNOTIFICATIONS_TYPES[notification.type] == notification.type) { if (notification.type == 'NewIncomingTx') { var opts = {}; @@ -158,4 +158,4 @@ PushNotificationService.prototype.sendPushNotification = function(notification, } }; -module.exports = PushNotificationService; +module.exports = PushNotificationsService; diff --git a/pushnotificationsservice/pushnotificationsservice.js b/pushnotificationsservice/pushnotificationsservice.js index 9555a80..d1eddc0 100644 --- a/pushnotificationsservice/pushnotificationsservice.js +++ b/pushnotificationsservice/pushnotificationsservice.js @@ -7,10 +7,10 @@ var log = require('npmlog'); log.debug = log.verbose; var config = require('../config'); -var PushNotificationService = require('../lib/pushnotificationservice'); +var PushNotificationService = require('../lib/pushnotificationsservice'); -var PushNotificationService = new PushNotificationService(); -PushNotificationService.start(config, function(err) { +var PushNotificationsService = new PushNotificationsService(); +PushNotificationsService.start(config, function(err) { if (err) throw err; console.log('Push Notification Service started'); diff --git a/start.sh b/start.sh index 2f94c90..bfe1e55 100755 --- a/start.sh +++ b/start.sh @@ -33,6 +33,6 @@ run_program locker/locker.js pids/locker.pid logs/locker.log run_program messagebroker/messagebroker.js pids/messagebroker.pid logs/messagebroker.log run_program bcmonitor/bcmonitor.js pids/bcmonitor.pid logs/bcmonitor.log run_program emailservice/emailservice.js pids/emailservice.pid logs/emailservice.log -run_program pushnotificationservice/pushnotificationservice.js pids/pushnotificationservice.pid logs/pushnotificationservice.log +run_program pushnotificationsservice/pushnotificationsservice.js pids/pushnotificationsservice.pid logs/pushnotificationsservice.log run_program bws.js pids/bws.pid logs/bws.log diff --git a/stop.sh b/stop.sh index f6a83ac..b15de9d 100755 --- a/stop.sh +++ b/stop.sh @@ -13,7 +13,7 @@ stop_program () stop_program pids/bws.pid stop_program pids/emailservice.pid stop_program pids/bcmonitor.pid -stop_program pids/pushnotificationservice.pid +stop_program pids/pushnotificationsservice.pid stop_program pids/messagebroker.pid stop_program pids/locker.pid