From 0f55ff2546fb96d50fccd16719fa8834f079f543 Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Mon, 5 Jun 2017 17:09:55 -0400 Subject: [PATCH] removed superseded initial coarse reverse call --- routes/v1.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/routes/v1.js b/routes/v1.js index 80c3d9b5..9fb8f8d2 100644 --- a/routes/v1.js +++ b/routes/v1.js @@ -97,14 +97,9 @@ 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( - isPipServiceEnabled, isCoarseReverse, not(hasRequestErrors) - ); - // fallback to coarse reverse when regular reverse didn't return anything - const coarse_reverse_fallback_should_execute = all( - isPipServiceEnabled, not(isCoarseReverse), not(hasRequestErrors), not(hasResponseData) + const coarse_reverse_should_execute = all( + isPipServiceEnabled, not(hasRequestErrors), not(hasResponseData) ); const placeholderShouldExecute = all( @@ -114,7 +109,7 @@ function addRoutes(app, peliasConfig) { // execute under the following conditions: // - there are no errors or data // - request is not coarse OR pip service is disabled - const original_reverse_should_execute = all( + const non_coarse_reverse_should_execute = all( not(hasResponseDataOrRequestErrors), any( not(isCoarseReverse), @@ -202,9 +197,8 @@ function addRoutes(app, peliasConfig) { sanitizers.reverse.middleware, middleware.requestLanguage, middleware.calcSize(), + controllers.search(peliasConfig.api, esclient, queries.reverse, non_coarse_reverse_should_execute), controllers.coarse_reverse(pipService, coarse_reverse_should_execute), - controllers.search(peliasConfig.api, esclient, queries.reverse, original_reverse_should_execute), - controllers.coarse_reverse(pipService, coarse_reverse_fallback_should_execute), postProc.distances('point.'), // reverse confidence scoring depends on distance from origin // so it must be calculated first