From 67bba11001a7e0c251cc09a5c58b4274a80bc2b7 Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Thu, 19 Jan 2017 14:19:55 -0500 Subject: [PATCH] removed object indirection in favor of function for easier proxyquire --- controller/search.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controller/search.js b/controller/search.js index f3ed67ad..b7d8bc6d 100644 --- a/controller/search.js +++ b/controller/search.js @@ -2,7 +2,7 @@ var _ = require('lodash'); -var service = { search: require('../service/search') }; +var searchService = require('../service/search'); var logger = require('pelias-logger').get('api'); var logging = require( '../helper/logging' ); const retry = require('retry'); @@ -62,7 +62,7 @@ function setup( apiConfig, esclient, query ){ operation.attempt((currentAttempt) => { // query elasticsearch - service.search( esclient, cmd, function( err, docs, meta ){ + searchService( esclient, cmd, function( err, docs, meta ){ // returns true if the operation should be attempted again // (handles bookkeeping of maxRetries) if (operation.retry(err)) {