|
|
@ -12,7 +12,6 @@ |
|
|
|
**/ |
|
|
|
**/ |
|
|
|
|
|
|
|
|
|
|
|
var peliasLogger = require( 'pelias-logger' ).get( 'service/mget' ); |
|
|
|
var peliasLogger = require( 'pelias-logger' ).get( 'service/mget' ); |
|
|
|
var microtime = require( 'microtime' ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function service( backend, query, cb ){ |
|
|
|
function service( backend, query, cb ){ |
|
|
|
|
|
|
|
|
|
|
@ -23,10 +22,8 @@ function service( backend, query, cb ){ |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var startTime = microtime.nowDouble(); |
|
|
|
|
|
|
|
// query new backend
|
|
|
|
// query new backend
|
|
|
|
backend().client.mget( cmd, function( err, data ){ |
|
|
|
backend().client.mget( cmd, function( err, data ){ |
|
|
|
peliasLogger.verbose( 'time elasticsearch query took:', microtime.nowDouble() - startTime ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// handle backend errors
|
|
|
|
// handle backend errors
|
|
|
|
if( err ){ return cb( err ); } |
|
|
|
if( err ){ return cb( err ); } |
|
|
|