rename client creation module
This commit is contained in:
@@ -3,7 +3,6 @@ import elasticsearch from 'elasticsearch';
|
|||||||
export default function createClient(options) {
|
export default function createClient(options) {
|
||||||
let client;
|
let client;
|
||||||
|
|
||||||
// if there's a transport property, assume it's a client instance
|
|
||||||
if (isClient(options)) {
|
if (isClient(options)) {
|
||||||
client = options;
|
client = options;
|
||||||
} else {
|
} else {
|
||||||
@@ -14,5 +13,6 @@ export default function createClient(options) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export function isClient(client) {
|
export function isClient(client) {
|
||||||
|
// if there's a transport property, assume it's a client instance
|
||||||
return !!client.transport;
|
return !!client.transport;
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@ import omit from 'lodash.omit';
|
|||||||
import Job from './job.js';
|
import Job from './job.js';
|
||||||
import Worker from './worker.js';
|
import Worker from './worker.js';
|
||||||
import constants from './constants';
|
import constants from './constants';
|
||||||
import createClient from './helpers/es_client';
|
import createClient from './helpers/create_client';
|
||||||
import indexTimestamp from './helpers/index_timestamp';
|
import indexTimestamp from './helpers/index_timestamp';
|
||||||
import logger from './helpers/logger';
|
import logger from './helpers/logger';
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import expect from 'expect.js';
|
|||||||
import proxyquire from 'proxyquire';
|
import proxyquire from 'proxyquire';
|
||||||
import elasticsearchMock from '../../fixtures/elasticsearch';
|
import elasticsearchMock from '../../fixtures/elasticsearch';
|
||||||
|
|
||||||
const module = proxyquire.noPreserveCache()('../../../lib/helpers/es_client', {
|
const module = proxyquire.noPreserveCache()('../../../lib/helpers/create_client', {
|
||||||
elasticsearch: elasticsearchMock
|
elasticsearch: elasticsearchMock
|
||||||
});
|
});
|
||||||
|
|
||||||
Reference in New Issue
Block a user