Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit 54f63f4

Browse files
authored
Merge pull request #471 from gibkigonzo/bugfix/393
Bugfix/393
2 parents c333ce9 + 987bbc7 commit 54f63f4

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77

8+
## [1.12.1] - UNRELEASED
9+
10+
### Fixed
11+
12+
- get proper tax calculation for multistore - @didkan (#464)
13+
- create only one ES client instance per app - @gibkigonzo (#393)
14+
15+
816
## [1.12.0] - 2020.06.01
917

1018
### Added

src/lib/elastic.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ function getHits (result) {
7373
}
7474
}
7575

76+
let esClient = null
7677
function getClient (config) {
7778
let { host, port, protocol, apiVersion, requestTimeout } = config.elasticsearch
7879
const node = `${protocol}://${host}:${port}`
@@ -83,7 +84,11 @@ function getClient (config) {
8384
auth = { username: user, password }
8485
}
8586

86-
return new es.Client({ node, auth, apiVersion, requestTimeout })
87+
if (!esClient) {
88+
esClient = new es.Client({ node, auth, apiVersion, requestTimeout })
89+
}
90+
91+
return esClient
8792
}
8893

8994
function putAlias (db, originalName, aliasName, next) {

0 commit comments

Comments
 (0)