aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/notificators
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/notificators')
-rw-r--r--src/main/java/org/traccar/notificators/NotificatorFirebase.java6
-rw-r--r--src/main/java/org/traccar/notificators/NotificatorTraccar.java5
2 files changed, 4 insertions, 7 deletions
diff --git a/src/main/java/org/traccar/notificators/NotificatorFirebase.java b/src/main/java/org/traccar/notificators/NotificatorFirebase.java
index a39683b2b..d75eb21a9 100644
--- a/src/main/java/org/traccar/notificators/NotificatorFirebase.java
+++ b/src/main/java/org/traccar/notificators/NotificatorFirebase.java
@@ -24,7 +24,6 @@ import com.google.firebase.messaging.AndroidNotification;
import com.google.firebase.messaging.ApnsConfig;
import com.google.firebase.messaging.Aps;
import com.google.firebase.messaging.FirebaseMessaging;
-import com.google.firebase.messaging.FirebaseMessagingException;
import com.google.firebase.messaging.MessagingErrorCode;
import com.google.firebase.messaging.MulticastMessage;
import org.slf4j.Logger;
@@ -40,7 +39,6 @@ import org.traccar.notification.MessageException;
import org.traccar.notification.NotificationFormatter;
import org.traccar.session.cache.CacheManager;
import org.traccar.storage.Storage;
-import org.traccar.storage.StorageException;
import org.traccar.storage.query.Columns;
import org.traccar.storage.query.Condition;
import org.traccar.storage.query.Request;
@@ -136,9 +134,9 @@ public class NotificatorFirebase implements Notificator {
storage.updateObject(user, new Request(
new Columns.Include("attributes"),
new Condition.Equals("id", user.getId())));
- cacheManager.updateOrInvalidate(true, user, ObjectOperation.UPDATE);
+ cacheManager.invalidateObject(true, User.class, user.getId(), ObjectOperation.UPDATE);
}
- } catch (FirebaseMessagingException | StorageException e) {
+ } catch (Exception e) {
LOGGER.warn("Firebase error", e);
}
}
diff --git a/src/main/java/org/traccar/notificators/NotificatorTraccar.java b/src/main/java/org/traccar/notificators/NotificatorTraccar.java
index 82e1584a5..717742a1e 100644
--- a/src/main/java/org/traccar/notificators/NotificatorTraccar.java
+++ b/src/main/java/org/traccar/notificators/NotificatorTraccar.java
@@ -27,7 +27,6 @@ import org.traccar.model.User;
import org.traccar.notification.NotificationFormatter;
import org.traccar.session.cache.CacheManager;
import org.traccar.storage.Storage;
-import org.traccar.storage.StorageException;
import org.traccar.storage.query.Columns;
import org.traccar.storage.query.Condition;
import org.traccar.storage.query.Request;
@@ -129,9 +128,9 @@ public class NotificatorTraccar implements Notificator {
storage.updateObject(user, new Request(
new Columns.Include("attributes"),
new Condition.Equals("id", user.getId())));
- cacheManager.updateOrInvalidate(true, user, ObjectOperation.UPDATE);
+ cacheManager.invalidateObject(true, User.class, user.getId(), ObjectOperation.UPDATE);
}
- } catch (StorageException e) {
+ } catch (Exception e) {
LOGGER.warn("Push error", e);
}
}