From 84aad3e1842afbd0b5d6f379833f0ca897009458 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Thu, 21 Jan 2016 13:40:24 +0000 Subject: [PATCH 1/5] unset messageOpts as well --- services/notifications/app/coffee/Notifications.coffee | 2 +- .../notifications/test/unit/coffee/NotificationsTests.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/notifications/app/coffee/Notifications.coffee b/services/notifications/app/coffee/Notifications.coffee index 9d61452e81..51001ea8eb 100644 --- a/services/notifications/app/coffee/Notifications.coffee +++ b/services/notifications/app/coffee/Notifications.coffee @@ -34,5 +34,5 @@ module.exports = user_id:user_id _id:ObjectId(notification_id) updateOperation = - "$unset": {templateKey:true} + "$unset": {templateKey:true, messageOpts: true} db.notifications.update searchOps, updateOperation, callback diff --git a/services/notifications/test/unit/coffee/NotificationsTests.coffee b/services/notifications/test/unit/coffee/NotificationsTests.coffee index adb58f6a48..d8ff753c4e 100644 --- a/services/notifications/test/unit/coffee/NotificationsTests.coffee +++ b/services/notifications/test/unit/coffee/NotificationsTests.coffee @@ -69,6 +69,6 @@ describe 'creating a user', -> user_id:user_id _id:ObjectId(notification_id) updateOperation = - "$unset": {templateKey:true} + "$unset": {templateKey:true, messageOpts:true} @updateStub.calledWith(searchOps, updateOperation).should.equal true done() From b53dd50340ebde8abee8e0b6ff0773ccc7928c6a Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Thu, 4 Feb 2016 13:38:33 +0000 Subject: [PATCH 2/5] default port 3041 --- services/notifications/app.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/notifications/app.coffee b/services/notifications/app.coffee index e831015aba..6ffb10ca44 100644 --- a/services/notifications/app.coffee +++ b/services/notifications/app.coffee @@ -39,6 +39,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 || 3041 app.listen port, host, -> logger.info "notifications starting up, listening on #{host}:#{port}" From 35e0eafc9573dd3aceb0b22da90d75d00420772b Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Thu, 4 Feb 2016 13:44:17 +0000 Subject: [PATCH 3/5] cleaned up health check a little --- .../app/coffee/HealthCheckController.coffee | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/services/notifications/app/coffee/HealthCheckController.coffee b/services/notifications/app/coffee/HealthCheckController.coffee index b41dc0290a..0a82ad4f62 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 From 7f74263cdcd5150067f41c17fc3e3ad351fad9b3 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Thu, 4 Feb 2016 13:46:59 +0000 Subject: [PATCH 4/5] default port to 3042 --- services/notifications/app.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/notifications/app.coffee b/services/notifications/app.coffee index 6ffb10ca44..b824094323 100644 --- a/services/notifications/app.coffee +++ b/services/notifications/app.coffee @@ -39,6 +39,6 @@ app.get '*', (req, res)-> res.send 404 host = Settings.internal?.notifications?.host || "localhost" -port = Settings.internal?.notifications?.port || 3041 +port = Settings.internal?.notifications?.port || 3042 app.listen port, host, -> logger.info "notifications starting up, listening on #{host}:#{port}" From 8050f5ea08777002a30d2f999110873fa88d4ce5 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Thu, 4 Feb 2016 14:22:13 +0000 Subject: [PATCH 5/5] change settings to 3042 --- services/notifications/config/settings.defaults.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: