Skip to content

Commit 00c3e22

Browse files
committed
fix: disable custom notifications scheduler to prevent system to crash
1 parent e31a0c1 commit 00c3e22

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/server/customNotificationScheduler.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,17 @@ const customNotificationMap: Record<string, CronJob> = {};
1919
* Global function called on server start to initialize all the custom notification.
2020
*/
2121
const customNotificationScheduler = async () => {
22-
const applications = await Application.find({
23-
customNotifications: { $elemMatch: { status: 'active' } },
24-
});
25-
26-
for (const application of applications) {
27-
if (!!application.customNotifications) {
28-
for await (const notification of application.customNotifications) {
29-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
30-
scheduleCustomNotificationJob(notification, application);
31-
}
32-
}
33-
}
22+
// const applications = await Application.find({
23+
// customNotifications: { $elemMatch: { status: 'active' } },
24+
// });
25+
// for (const application of applications) {
26+
// if (!!application.customNotifications) {
27+
// for await (const notification of application.customNotifications) {
28+
// // eslint-disable-next-line @typescript-eslint/no-use-before-define
29+
// scheduleCustomNotificationJob(notification, application);
30+
// }
31+
// }
32+
// }
3433
};
3534

3635
export default customNotificationScheduler;

0 commit comments

Comments
 (0)