Changes from map() to doOnNext().
put() can return null if there was no entry, this caused intermittent NPE.
This commit is contained in:
@@ -68,7 +68,7 @@ public class CachingRouteDefinitionLocator
|
||||
@Override
|
||||
public void onApplicationEvent(RefreshRoutesEvent event) {
|
||||
fetch().materialize().collect(Collectors.toList())
|
||||
.map(routes -> cache.put(CACHE_KEY, routes)).subscribe();
|
||||
.doOnNext(routes -> cache.put(CACHE_KEY, routes)).subscribe();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
|
||||
@@ -70,7 +70,7 @@ public class CachingRouteLocator
|
||||
@Override
|
||||
public void onApplicationEvent(RefreshRoutesEvent event) {
|
||||
fetch().materialize().collect(Collectors.toList())
|
||||
.map(routes -> cache.put(CACHE_KEY, routes)).subscribe();
|
||||
.doOnNext(routes -> cache.put(CACHE_KEY, routes)).subscribe();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
|
||||
Reference in New Issue
Block a user