@dekproject/elasticsearch
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -25,2 +25,4 @@ 'use strict'; | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | ||
exports.default = function () { | ||
@@ -30,2 +32,4 @@ try { | ||
var hosts = env.ELASTICSEARCH_HOST.indexOf(",") > -1 ? env.ELASTICSEARCH_HOST.split(",") : env.ELASTICSEARCH_HOST; | ||
hosts = [].concat(_toConsumableArray(new Set(hosts))); //Fix duplicate hosts (@farchanjo) | ||
var client = null; | ||
@@ -48,5 +52,5 @@ | ||
} catch (e) { | ||
console.log('[ Elasticsearch ] - ' + e.message); | ||
console.log('[ Elasticsearch ] - ' + e.message, e); | ||
} | ||
}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@dekproject/elasticsearch", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Elasticsearch interface plugin for DEK", | ||
"main": "./build/index.js", | ||
"contributors": [ | ||
"Fabricio Archanjo <fabricio@vigiadepreco.com.br>" | ||
], | ||
"scripts": { | ||
@@ -7,0 +10,0 @@ "dev": "npm run build && babel-node sample --presets env", |
@@ -10,2 +10,4 @@ import { $ } from "@dekproject/scope"; | ||
let hosts = (env.ELASTICSEARCH_HOST.indexOf(",") > -1) ? env.ELASTICSEARCH_HOST.split(",") : env.ELASTICSEARCH_HOST; | ||
hosts = [...new Set(hosts)];//Fix duplicate hosts (@farchanjo) | ||
let client = null; | ||
@@ -26,3 +28,3 @@ | ||
break; | ||
default: client = new Elasticsearch.Client( { hosts: hosts }); break; | ||
default: client = new Elasticsearch.Client( { hosts: hosts } ); break; | ||
} | ||
@@ -36,4 +38,4 @@ | ||
catch (e) { | ||
console.log(`[ Elasticsearch ] - ${e.message}`); | ||
console.log(`[ Elasticsearch ] - ${e.message}`, e); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
9960
82