refactor
This commit is contained in:
parent
bfc49c94f8
commit
b193685b41
|
@ -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;
|
||||
|
|
|
@ -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');
|
||||
|
|
2
start.sh
2
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
|
||||
|
||||
|
|
2
stop.sh
2
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue