-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Notifications for new matches #1657
base: master
Are you sure you want to change the base?
Conversation
} | ||
return cb(err, match.match_id); | ||
}); | ||
} | ||
|
||
function sendNotifications(match) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you probably have to check the origin of the parse request and do this for scanner only (similar to what was done for scenarios), otherwise, people requesting parses might cause multiple notifications?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code pointer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/odota/core/blob/master/svc/parser.js#L39
you could add something like doNotifications as a property on the match, or just check directly
return next(); | ||
}); | ||
|
||
notifications.route('/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this route used for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used to store the notification token on the server so that we know who to send notifications to.
@@ -61,9 +61,34 @@ function parseProcessor(job, cb) { | |||
console.error(err.stack || err); | |||
} else { | |||
console.log('completed parse of match %s', match.match_id); | |||
sendNotifications(match); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should make this only enabled if a config option is set. probably there are people using this that don't need this feature
No description provided.