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

Commit 542a050

Browse files
authored
Merge branch 'develop' into bugfix/442
2 parents cf00fb7 + 54f63f4 commit 542a050

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Fixed
1111

12-
- add error status code as number in `apiError` - @gibkigonzo (#442)
13-
12+
- AAdd error status code as number in `apiError` - @gibkigonzo (#442)
13+
- Get proper tax calculation for multistore - @didkan (#464)
14+
- Create only one ES client instance per app - @gibkigonzo (#393)
1415

1516
## [1.12.0] - 2020.06.01
1617

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)