diff --git a/routes/v1.js b/routes/v1.js index fc8fe556..80c3d9b5 100644 --- a/routes/v1.js +++ b/routes/v1.js @@ -97,12 +97,14 @@ function addRoutes(app, peliasConfig) { const placeholderService = serviceWrapper(placeholderConfiguration); const isPlaceholderServiceEnabled = _.constant(placeholderConfiguration.isEnabled()); + // use coarse reverse when requested layers are all coarse 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( - isPipServiceEnabled, not(hasRequestErrors), not(hasResponseData), not(isCoarseReverse) + isPipServiceEnabled, not(isCoarseReverse), not(hasRequestErrors), not(hasResponseData) ); const placeholderShouldExecute = all(