aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/database
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-12-17 11:43:51 -0800
committerAnton Tananaev <anton@traccar.org>2023-12-17 11:43:51 -0800
commitc165968c2eb24b1c4a35dab39174b4df3576551c (patch)
tree6dae35ddec3feb14151e5c711f4d0f5865cbc64e /src/main/java/org/traccar/database
parent4dc2e86ae5e403143b3c4e2c1a3bd671dfeaf5f8 (diff)
downloadtrackermap-server-c165968c2eb24b1c4a35dab39174b4df3576551c.tar.gz
trackermap-server-c165968c2eb24b1c4a35dab39174b4df3576551c.tar.bz2
trackermap-server-c165968c2eb24b1c4a35dab39174b4df3576551c.zip
Improve cache update performance
Diffstat (limited to 'src/main/java/org/traccar/database')
-rw-r--r--src/main/java/org/traccar/database/NotificationManager.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/database/NotificationManager.java b/src/main/java/org/traccar/database/NotificationManager.java
index 79585d67a..45263ff3c 100644
--- a/src/main/java/org/traccar/database/NotificationManager.java
+++ b/src/main/java/org/traccar/database/NotificationManager.java
@@ -29,7 +29,6 @@ import org.traccar.model.Device;
import org.traccar.model.Event;
import org.traccar.model.Geofence;
import org.traccar.model.Maintenance;
-import org.traccar.model.Notification;
import org.traccar.model.Position;
import org.traccar.notification.MessageException;
import org.traccar.notification.NotificatorManager;
@@ -88,7 +87,7 @@ public class NotificationManager {
return;
}
- var notifications = cacheManager.getDeviceObjects(event.getDeviceId(), Notification.class).stream()
+ var notifications = cacheManager.getDeviceNotifications(event.getDeviceId())
.filter(notification -> notification.getType().equals(event.getType()))
.filter(notification -> {
if (event.getType().equals(Event.TYPE_ALARM)) {
@@ -162,7 +161,7 @@ public class NotificationManager {
try {
cacheManager.addDevice(event.getDeviceId());
updateEvent(event, position);
- } catch (StorageException e) {
+ } catch (Exception e) {
throw new RuntimeException(e);
} finally {
cacheManager.removeDevice(event.getDeviceId());