diff --git a/services/app-messages.js b/services/app-messages.js index 8482d7e..2654ec1 100644 --- a/services/app-messages.js +++ b/services/app-messages.js @@ -12,8 +12,7 @@ }, ping: { tooRecent: 'Can\'t accept the request because the minimum seconds between pings is %s and you pinged us %s seconds ago.', - readResource: 'The ping was cancelled because there was an error reading the resource at URL %s.', - noSubscriptions: 'No subscriptions found for resource.' + readResource: 'The ping was cancelled because there was an error reading the resource at URL %s.' } }, log: { diff --git a/services/notify-subscribers.js b/services/notify-subscribers.js index 6e1713b..fd72b0b 100644 --- a/services/notify-subscribers.js +++ b/services/notify-subscribers.js @@ -9,7 +9,7 @@ var apiurl, subscriptions; if (undefined === data.subscriptions[resourceUrl]) { - return callback(sprintf(appMessage.error.ping.noSubscriptions, resourceUrl)); + return callback(null); } subscriptions = data.subscriptions[resourceUrl]; diff --git a/services/ping.js b/services/ping.js index 167f4ef..11f69a4 100644 --- a/services/ping.js +++ b/services/ping.js @@ -4,6 +4,7 @@ var appMessage = require('./app-messages'), async = require('async'), crypto = require('crypto'), + initData = require('./init-data'), initResource = require('./init-resource'), logEvent = require('./log-event'), moment = require('moment'), @@ -74,6 +75,7 @@ async.waterfall([ function (callback) { + initData(data); resource = initResource(data, resourceUrl); callback(null); }, diff --git a/services/please-notify.js b/services/please-notify.js index 3ae3a6e..128a635 100644 --- a/services/please-notify.js +++ b/services/please-notify.js @@ -3,6 +3,7 @@ var appMessage = require('./app-messages'), async = require('async'), + initData = require('./init-data'), initSubscription = require('./init-subscription'), logEvent = require('./log-event'), moment = require('moment'), @@ -56,6 +57,10 @@ parts = url.parse(apiurl); async.waterfall([ + function (callback) { + initData(data); + callback(null); + }, function (callback) { checkresourceUrlStatusCodes(urlList, callback); },