add optional debugging output
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
import events from 'events';
|
||||
import createClient from './helpers/es_client';
|
||||
import indexTimestamp from './helpers/index_timestamp';
|
||||
import logger from './helpers/logger';
|
||||
import Job from './job.js';
|
||||
import Worker from './worker.js';
|
||||
import { omit } from 'lodash';
|
||||
|
||||
const debug = logger('queue');
|
||||
|
||||
export default class Elastique extends events.EventEmitter {
|
||||
constructor(index, options = {}) {
|
||||
if (!index) throw new Error('Must specify an index to write to');
|
||||
@@ -21,12 +24,14 @@ export default class Elastique extends events.EventEmitter {
|
||||
}
|
||||
|
||||
_initTasks() {
|
||||
|
||||
var initTasks = [
|
||||
this.client.ping({ timeout: 3000 }),
|
||||
];
|
||||
|
||||
return Promise.all(initTasks);
|
||||
return Promise.all(initTasks).catch((err) => {
|
||||
debug('Initialization failed', err);
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
|
||||
add(type, payload, opts = {}) {
|
||||
|
||||
Reference in New Issue
Block a user