Browse Source

fix push notifications service logs

activeAddress
Javier 9 years ago
parent
commit
b4d94da709
  1. 9
      lib/pushnotificationsservice.js

9
lib/pushnotificationsservice.js

@ -98,12 +98,13 @@ PushNotificationsService.prototype._sendPushNotifications = function(notificatio
var notifType = PUSHNOTIFICATIONS_TYPES[notification.type]; var notifType = PUSHNOTIFICATIONS_TYPES[notification.type];
if (!notifType) return cb(); if (!notifType) return cb();
log.debug('\n### Notification received\n', JSON.stringify(notification)); log.debug('### Notification received: ' + notification.type);
log.debug(JSON.stringify(notification));
self._checkShouldSendNotif(notification, function(err, should) { self._checkShouldSendNotif(notification, function(err, should) {
if (err) return cb(err); if (err) return cb(err);
log.debug('\nShould send notification: ', should); log.debug('Should send notification: ', should);
if (!should) return cb(); if (!should) return cb();
self._getRecipientsList(notification, function(err, recipientsList) { self._getRecipientsList(notification, function(err, recipientsList) {
@ -137,8 +138,8 @@ PushNotificationsService.prototype._sendPushNotifications = function(notificatio
async.each(optsList, async.each(optsList,
function(opts, next) { function(opts, next) {
self._makeRequest(opts, function(err, response) { self._makeRequest(opts, function(err, response) {
if (err) log.error('ERROR!: ', err); if (err) log.error(err);
log.debug('Request status : ', response); if (response) log.debug('Request status : ', response.statusCode);
next(); next();
}); });
}, },

Loading…
Cancel
Save