This commit is contained in:
syuilo
2019-02-07 21:02:33 +09:00
parent 27768081e2
commit 5448c22031
19 changed files with 125 additions and 194 deletions

View File

@@ -42,10 +42,9 @@ const index = {
};
// Init ElasticSearch connection
const client = config.elasticsearch.map(({ host, port }) => {
return new elasticsearch.Client({ host: `${host}:${port}` });
}).getOrElse(null);
const client = config.elasticsearch ? new elasticsearch.Client({
host: `${config.elasticsearch.host}:${config.elasticsearch.port}`
}) : null;
if (client) {
// Send a HEAD request