added a warning about reusing config objects to the config docs and to the Client constructor
This commit is contained in:
@ -32,6 +32,13 @@ var _ = require('./utils');
|
||||
function Client(config) {
|
||||
config = config || {};
|
||||
|
||||
if (config.__reused) {
|
||||
throw new Error('Do not reuse objects to configure the elasticsearch Client class: ' +
|
||||
'https://github.com/elasticsearch/elasticsearch-js/issues/33');
|
||||
} else {
|
||||
config.__reused = true;
|
||||
}
|
||||
|
||||
function EsApiClient() {
|
||||
// our client will log minimally by default
|
||||
if (!config.hasOwnProperty('log')) {
|
||||
|
||||
Reference in New Issue
Block a user