diff --git a/services/notifications/app.coffee b/services/notifications/app.coffee index dc6262cfbe..8b78c4b8f8 100644 --- a/services/notifications/app.coffee +++ b/services/notifications/app.coffee @@ -40,6 +40,6 @@ app.get '*', (req, res)-> res.send 404 host = Settings.internal?.notifications?.host || "localhost" -port = Settings.internal?.notifications?.port || 3033 +port = Settings.internal?.notifications?.port || 3042 app.listen port, host, -> logger.info "notifications starting up, listening on #{host}:#{port}" diff --git a/services/notifications/app/coffee/HealthCheckController.coffee b/services/notifications/app/coffee/HealthCheckController.coffee index 7c78ea37a6..f9ac5a4100 100644 --- a/services/notifications/app/coffee/HealthCheckController.coffee +++ b/services/notifications/app/coffee/HealthCheckController.coffee @@ -26,18 +26,21 @@ module.exports = opts.json = true request.get opts, (err, res, body)-> if res.statusCode != 200 - return cb("status code not 200, its #{res.statusCode}") + e = "status code not 200 #{res.statusCode}" + logger.err err:err, e + return cb(e) hasNotification = _.some body, (notification)-> notification.key == notification_key and notification.user_id == user_id.toString() if hasNotification - cb(null,body) + cb(null, body) else - logger.log body:body, "what is in the body" + logger.log body:body, "got notifications response for health check" return cb("notification not found in response") ] async.series jobs, (err, body)-> if err? + logger.err err:err, "error running health check" return callback(err) else notification_id = body[1][0]._id diff --git a/services/notifications/app/coffee/Notifications.coffee b/services/notifications/app/coffee/Notifications.coffee index a24c8662a5..f9a6adc86a 100644 --- a/services/notifications/app/coffee/Notifications.coffee +++ b/services/notifications/app/coffee/Notifications.coffee @@ -34,7 +34,7 @@ module.exports = user_id:ObjectId(user_id) _id:ObjectId(notification_id) updateOperation = - "$unset": {templateKey:true} + "$unset": {templateKey:true, messageOpts: true} db.notifications.update searchOps, updateOperation, callback removeNotificationKey: (user_id, notification_key, callback)-> diff --git a/services/notifications/config/settings.defaults.coffee b/services/notifications/config/settings.defaults.coffee index d2f8db25ef..d6bbdbb869 100644 --- a/services/notifications/config/settings.defaults.coffee +++ b/services/notifications/config/settings.defaults.coffee @@ -1,7 +1,7 @@ module.exports = Settings = internal: notifications: - port: 3033 + port: 3042 host: "localhost" mongo: diff --git a/services/notifications/test/unit/coffee/NotificationsTests.coffee b/services/notifications/test/unit/coffee/NotificationsTests.coffee index 191324df1d..47f31a3d06 100644 --- a/services/notifications/test/unit/coffee/NotificationsTests.coffee +++ b/services/notifications/test/unit/coffee/NotificationsTests.coffee @@ -69,7 +69,7 @@ describe 'Notifications Tests', -> user_id:ObjectId(user_id) _id:ObjectId(notification_id) updateOperation = - "$unset": {templateKey:true} + "$unset": {templateKey:true, messageOpts:true} @updateStub.calledWith(searchOps, updateOperation).should.equal true done() @@ -84,4 +84,4 @@ describe 'Notifications Tests', -> updateOperation = "$unset": {templateKey:true} @updateStub.calledWith(searchOps, updateOperation).should.equal true - done() \ No newline at end of file + done()