Allow to leave out some configurations even in production.

This commit is contained in:
Adrian Winterstein 2024-09-28 16:23:16 +02:00
parent 98c99d906e
commit 5a2cb5325b
No known key found for this signature in database
GPG key ID: EDBA4B9F8D8E37AE
2 changed files with 6 additions and 1 deletions

View file

@ -28,6 +28,11 @@ function removePushDevice (user, pushDevice) {
export const MAX_MESSAGE_LENGTH = 300;
async function sendFCMNotification (user, pushDevice, payload) {
if (nconf.get('FIREBASE_PROJECT_ID') === undefined || nconf.get('FIREBASE_PROJECT_ID') === '') {
logger.info('Will not send push notification, because Firebase is not configured.');
return;
}
const messaging = admin.messaging();
if (messaging === undefined) {
return;

View file

@ -20,7 +20,7 @@ let flagSlack;
let subscriptionSlack;
try {
if (IS_TEST || IS_PRODUCTION) {
if ((IS_TEST || IS_PRODUCTION) && SLACK_FLAGGING_URL && SLACK_SUBSCRIPTIONS_URL) {
flagSlack = new IncomingWebhook(SLACK_FLAGGING_URL);
subscriptionSlack = new IncomingWebhook(SLACK_SUBSCRIPTIONS_URL);
} else {