From 6918d866b8f9d66e46e84deb6ddd061236116b7c Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Wed, 25 Jan 2017 08:59:29 -0500 Subject: [PATCH] added comments clarifying retry logic --- controller/place.js | 6 ++++++ controller/search.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/controller/place.js b/controller/place.js index 9e41a47c..b2efdf04 100644 --- a/controller/place.js +++ b/controller/place.js @@ -53,6 +53,12 @@ function setup( apiConfig, esclient ){ return; } + // if execution has gotten this far then one of three things happened: + // - the request didn't time out + // - maxRetries has been hit so we're giving up + // - another error occurred + // in either case, handle the error or results + // error handler if( err ){ if (_.isObject(err) && err.message) { diff --git a/controller/search.js b/controller/search.js index 168e47c4..2813bf3c 100644 --- a/controller/search.js +++ b/controller/search.js @@ -80,6 +80,12 @@ function setup( apiConfig, esclient, query ){ return; } + // if execution has gotten this far then one of three things happened: + // - the request didn't time out + // - maxRetries has been hit so we're giving up + // - another error occurred + // in either case, handle the error or results + // error handler if( err ){ if (_.isObject(err) && err.message) {