|
|
@ -97,12 +97,14 @@ function addRoutes(app, peliasConfig) { |
|
|
|
const placeholderService = serviceWrapper(placeholderConfiguration); |
|
|
|
const placeholderService = serviceWrapper(placeholderConfiguration); |
|
|
|
const isPlaceholderServiceEnabled = _.constant(placeholderConfiguration.isEnabled()); |
|
|
|
const isPlaceholderServiceEnabled = _.constant(placeholderConfiguration.isEnabled()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// use coarse reverse when requested layers are all coarse
|
|
|
|
const coarse_reverse_should_execute = all( |
|
|
|
const coarse_reverse_should_execute = all( |
|
|
|
not(hasRequestErrors), isPipServiceEnabled, isCoarseReverse |
|
|
|
isPipServiceEnabled, isCoarseReverse, not(hasRequestErrors) |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// fallback to coarse reverse when regular reverse didn't return anything
|
|
|
|
const coarse_reverse_fallback_should_execute = all( |
|
|
|
const coarse_reverse_fallback_should_execute = all( |
|
|
|
isPipServiceEnabled, not(hasRequestErrors), not(hasResponseData), not(isCoarseReverse) |
|
|
|
isPipServiceEnabled, not(isCoarseReverse), not(hasRequestErrors), not(hasResponseData) |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const placeholderShouldExecute = all( |
|
|
|
const placeholderShouldExecute = all( |
|
|
|