|
|
@ -11,6 +11,9 @@ |
|
|
|
|
|
|
|
|
|
|
|
**/ |
|
|
|
**/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var peliasLogger = require( 'pelias-logger' ).get( 'service/mget' ); |
|
|
|
|
|
|
|
var microtime = require( 'microtime' ); |
|
|
|
|
|
|
|
|
|
|
|
function service( backend, query, cb ){ |
|
|
|
function service( backend, query, cb ){ |
|
|
|
|
|
|
|
|
|
|
|
// backend command
|
|
|
|
// backend command
|
|
|
@ -20,8 +23,10 @@ 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 ); } |
|
|
|