Skip to content

Commit

Permalink
Regression: Unhandled Exceptions metric causing a secondary exception (
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre-lehnen-rc committed Jul 1, 2022
1 parent c1a8ee2 commit 83f0043
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/meteor/app/lib/server/lib/meteorFixes.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { MongoInternals } from 'meteor/mongo';

import { Settings } from '../../../models/server';
import { Settings } from '@rocket.chat/models';

const timeoutQuery = parseInt(process.env.OBSERVERS_CHECK_TIMEOUT) || 2 * 60 * 1000;
const interval = parseInt(process.env.OBSERVERS_CHECK_INTERVAL) || 60 * 1000;
Expand Down Expand Up @@ -60,8 +59,9 @@ Meteor.setInterval(() => {
* we will start respecting this and exit the process to prevent these kind of problems.
*/

process.on('unhandledRejection', (error) => {
Settings.incrementValueById('Uncaught_Exceptions_Count');
process.on('unhandledRejection', async (error) => {
await Settings.incrementValueById('Uncaught_Exceptions_Count');

console.error('=== UnHandledPromiseRejection ===');
console.error(error);
console.error('---------------------------------');
Expand Down

0 comments on commit 83f0043

Please sign in to comment.