From 7ccffa266e87badbbcfde73db86216fd4c667f35 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 11 Jul 2022 20:35:07 -0700 Subject: Fix offline notifications (fix #4889) --- .../java/org/traccar/database/NotificationManager.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/traccar/database/NotificationManager.java b/src/main/java/org/traccar/database/NotificationManager.java index 1314a3d0a..ecb44b1d4 100644 --- a/src/main/java/org/traccar/database/NotificationManager.java +++ b/src/main/java/org/traccar/database/NotificationManager.java @@ -99,15 +99,13 @@ public class NotificationManager { notifications.forEach(notification -> { cacheManager.getNotificationUsers(notification.getId()).forEach(user -> { - new Thread(() -> { - for (String notificator : notification.getNotificatorsTypes()) { - try { - notificatorManager.getNotificator(notificator).send(user, event, position); - } catch (MessageException | InterruptedException exception) { - LOGGER.warn("Notification failed", exception); - } + for (String notificator : notification.getNotificatorsTypes()) { + try { + notificatorManager.getNotificator(notificator).send(user, event, position); + } catch (MessageException | InterruptedException exception) { + LOGGER.warn("Notification failed", exception); } - }).start(); + } }); }); } -- cgit v1.2.3