Browse Source

reordered predicates, added comments

pull/899/head
Stephen Hess 8 years ago
parent
commit
3764b928c5
  1. 6
      routes/v1.js

6
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(

Loading…
Cancel
Save