mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[elasticsearch/client] use bluebird for promises for better backward compat
This commit is contained in:
parent
d5e76b0d16
commit
1e507a90b3
3 changed files with 12 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
import elasticsearch from 'elasticsearch';
|
||||
import _ from 'lodash';
|
||||
import Bluebird from 'bluebird';
|
||||
const readFile = (file) => require('fs').readFileSync(file, 'utf8');
|
||||
import util from 'util';
|
||||
import url from 'url';
|
||||
|
@ -44,6 +45,9 @@ module.exports = function (server) {
|
|||
plugins: options.plugins,
|
||||
apiVersion: options.apiVersion,
|
||||
keepAlive: options.keepAlive,
|
||||
defer: function () {
|
||||
return Bluebird.defer();
|
||||
},
|
||||
log: function () {
|
||||
this.error = function (err) {
|
||||
server.log(['error', 'elasticsearch'], err);
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
import Scanner from 'ui/utils/scanner';
|
||||
import expect from 'expect.js';
|
||||
import Bluebird from 'bluebird';
|
||||
import elasticsearch from 'elasticsearch-browser';
|
||||
import sinon from 'sinon';
|
||||
|
||||
var es = new elasticsearch.Client({
|
||||
host: 'http://localhost:9210',
|
||||
defer: function () {
|
||||
return Bluebird.defer();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
5
test/fixtures/scenario_manager.js
vendored
5
test/fixtures/scenario_manager.js
vendored
|
@ -9,7 +9,10 @@ function ScenarioManager(server) {
|
|||
// NOTE: some large sets of test data can take several minutes to load
|
||||
this.client = new elasticsearch.Client({
|
||||
host: server,
|
||||
requestTimeout: 300000
|
||||
requestTimeout: 300000,
|
||||
defer: function () {
|
||||
return Promise.defer();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue