Fase 1a: flag de cutover notifDisabledChannels en processNotif
Guard reversible al inicio de processNotif: los canales listados en settings.private.notifDisabledChannels (p.ej. ['mobile','web']) los gestiona el microservicio tcef-notifications, y el observer/cron viejos los ignoran. Exclusion mutua por canal sin desplegar codigo (solo editar settings). ES5-compatible (Meteor 1.6 / Node 8).
This commit is contained in:
parent
9d92ec4f88
commit
39415808bf
1 changed files with 11 additions and 0 deletions
|
|
@ -43,7 +43,18 @@ function imgUrl(lat, lng) {
|
||||||
return `<img src="${imgUrl(lat, lng)}" width="640" height="480"/>`;
|
return `<img src="${imgUrl(lat, lng)}" width="640" height="480"/>`;
|
||||||
} */
|
} */
|
||||||
|
|
||||||
|
// Cutover flag (fase 1a): channels listed in
|
||||||
|
// Meteor.settings.private.notifDisabledChannels (e.g. ['mobile','web']) are
|
||||||
|
// handled by the tcef-notifications microservice, so the old observer/cron must
|
||||||
|
// NOT send them. Mutual exclusion per channel — reversible by editing settings,
|
||||||
|
// no code deploy needed. ES5-compatible on purpose (Meteor 1.6 / Node 8).
|
||||||
|
const notifDisabledChannels = (Meteor.settings.private && Meteor.settings.private.notifDisabledChannels) || [];
|
||||||
|
|
||||||
const processNotif = (notif) => {
|
const processNotif = (notif) => {
|
||||||
|
if (notifDisabledChannels.indexOf(notif.type) !== -1) {
|
||||||
|
// This channel was migrated to tcef-notifications; do nothing here.
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (isMailServerMaster && validFcmSender && notif.type === 'mobile' && notif.notified !== true) {
|
if (isMailServerMaster && validFcmSender && notif.type === 'mobile' && notif.notified !== true) {
|
||||||
const fcmSender = new gcm.Sender(Meteor.settings.private.fcmApiToken);
|
const fcmSender = new gcm.Sender(Meteor.settings.private.fcmApiToken);
|
||||||
const user = Meteor.users.findOne({ _id: notif.userId });
|
const user = Meteor.users.findOne({ _id: notif.userId });
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue