Skip to content

Commit 4cba87a

Browse files
author
vikasrohit
authored
Merge pull request #122 from topcoder-platform/hotfix/handling_unhandled_error_in_getting_mentioned_user_details
Hotfix/handling unhandled error in getting mentioned user details
2 parents 1d414fc + 6321083 commit 4cba87a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

connect/connectNotificationServer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ const getNotificationsForMentionedUser = (logger, eventConfig, content) => {
9595
notification.userId = mentionedUser ? mentionedUser.userId.toString() : notification.userHandle;
9696
});
9797
resolve(notifications);
98-
}).catch((error) => {
98+
})/*.catch((error) => {
9999
if (logger) {
100100
logger.error(error);
101101
logger.info('Unable to send notification to mentioned user')
102102
}
103103
//resolves with empty notification which essentially means we are unable to send notification to mentioned user
104104
resolve([]);
105-
});
105+
})*/;
106106
} else {
107107
resolve([]);
108108
}

src/app.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,17 @@ function startKafkaConsumer(handlers, notificationServiceHandlers) {
7676
});
7777

7878
const check = function () {
79+
logger.debug('Checking Health...') ;
7980
if (!consumer.client.initialBrokers && !consumer.client.initialBrokers.length) {
81+
logger.debug('Found unhealthy Kafka Brokers...');
8082
return false;
8183
}
8284
let connected = true;
8385
consumer.client.initialBrokers.forEach(conn => {
8486
logger.debug(`url ${conn.server()} - connected=${conn.connected}`);
8587
connected = conn.connected & connected;
8688
});
89+
logger.debug('Found all Kafka Brokers healthy...');
8790
return connected;
8891
};
8992

0 commit comments

Comments
 (0)