aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/traccar/database/NotificationManager.java14
1 files changed, 6 insertions, 8 deletions
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();
+ }
});
});
}