diff options
-rw-r--r-- | src/org/traccar/api/resource/GeofenceResource.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/org/traccar/api/resource/GeofenceResource.java b/src/org/traccar/api/resource/GeofenceResource.java index 960ab813f..615606cdc 100644 --- a/src/org/traccar/api/resource/GeofenceResource.java +++ b/src/org/traccar/api/resource/GeofenceResource.java @@ -45,9 +45,13 @@ public class GeofenceResource extends BaseResource { @GET public Collection<Geofence> get( @QueryParam("all") boolean all, @QueryParam("userId") long userId, @QueryParam("groupId") long groupId, - @QueryParam("deviceId") long deviceId) throws SQLException { + @QueryParam("deviceId") long deviceId, @QueryParam("refresh") boolean refresh) throws SQLException { GeofenceManager geofenceManager = Context.getGeofenceManager(); + if (refresh) { + geofenceManager.refreshGeofences(); + } + Set<Long> result; if (all) { Context.getPermissionsManager().checkAdmin(getUserId()); @@ -57,7 +61,7 @@ public class GeofenceResource extends BaseResource { userId = getUserId(); } Context.getPermissionsManager().checkUser(getUserId(), userId); - result = new HashSet<Long>(geofenceManager.getUserGeofencesIds(userId)); + result = new HashSet<>(geofenceManager.getUserGeofencesIds(userId)); } if (groupId != 0) { |