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