aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-07-11 20:35:07 -0700
committerAnton Tananaev <anton@traccar.org>2022-07-11 20:35:07 -0700
commit7ccffa266e87badbbcfde73db86216fd4c667f35 (patch)
tree97aa7cbf1890aab0b40e500ffee72ab5e3c7acb6 /src/main/java/org/traccar
parent42140ceae97b3da66a54b0b5480242adf0b4e23e (diff)
downloadtrackermap-server-7ccffa266e87badbbcfde73db86216fd4c667f35.tar.gz
trackermap-server-7ccffa266e87badbbcfde73db86216fd4c667f35.tar.bz2
trackermap-server-7ccffa266e87badbbcfde73db86216fd4c667f35.zip
Fix offline notifications (fix #4889)
Diffstat (limited to 'src/main/java/org/traccar')
-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();
+ }
});
});
}