Skip to content

Commit

Permalink
Closes #7.
Browse files Browse the repository at this point in the history
  • Loading branch information
Asgeir Nilsen committed Jun 20, 2018
1 parent fe3eb27 commit 6beaf9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/no/fint/cache/CacheService.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public List<T> getAll(String orgId, long sinceTimestamp) {
public Optional<T> getOne(String orgId, Predicate<T> idFunction) {
Optional<Cache<T>> cache = getCache(orgId);
if (cache.isPresent()) {
return cache.get().filter(idFunction).map(CacheObject::getObject).findAny();
return cache.get().filter(idFunction).max(Comparator.comparingLong(CacheObject::getLastUpdated)).map(CacheObject::getObject);
}
return Optional.empty();
}
Expand Down

0 comments on commit 6beaf9e

Please sign in to comment.