Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

refactor(server): remove separate notifier process #1800

Merged
merged 2 commits into from
Apr 20, 2017
Merged

Conversation

vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Apr 6, 2017

cc @jrgm

Work in progress...

Fixes #1796

@vladikoff vladikoff added the WIP label Apr 6, 2017
@vladikoff vladikoff requested a review from jrgm April 6, 2017 00:03
@@ -150,7 +151,7 @@ Lug.prototype.notifyAttachedServices = function (name, request, data) {
data: unbuffer(data)
}
e.data.metricsContext = metricsContextData
this.stdout.write(JSON.stringify(e) + '\n')
this.notifier.send(e)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Um, yes please!

@vladikoff
Copy link
Contributor Author

@jrgm r? @mozilla/fxa-devs r?

@shane-tomlinson shane-tomlinson requested review from vbudhram and removed request for jrgm April 20, 2017 16:14
Copy link
Contributor

@vbudhram vbudhram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vladikoff Looks good, just a couple things. Noticed that key_server.js logs to stdout. Should it be updated to emit sns event?

lib/notifier.js Outdated
const AWS = require('aws-sdk')
const config = require('../config')

const snsTopicArn = config.get('snsTopicArn')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The config value name snsTopicArn doesn't mention what the topic is used for. Maybe notifierSnsTopicArn?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will probably require changes to existing configs in puppet, etc. So I'd rather just leave it alone, I can rename the local variable though

it('works with sns configuration', () => {
const config = {
get: (key) => {
if(key === 'snsTopicArn') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit space after if

it('works with disabled configuration', () => {
const config = {
get: (key) => {
if(key === 'snsTopicArn') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit space after if

lib/notifier.js Outdated
Message: JSON.stringify(msg)
}, (err, data) => {
if (err) {
log.error({op: 'Notifier.sent', err: err})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous file used Notifier.published, do we have any graphs or metrics that would need updating to use Notifier.sent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. reverting to the older name...

@vladikoff vladikoff removed the WIP label Apr 20, 2017
@vladikoff
Copy link
Contributor Author

Updated

@vladikoff vladikoff merged commit 7414ee8 into master Apr 20, 2017
@vladikoff vladikoff deleted the rm-notifier branch April 20, 2017 21:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants