add ELASTICSEARCH_REQUEST_TIMEOUT to ConfigManager
@@ -2,7 +2,8 @@
## v4.0.7-RC
-* Inprovement: Apply styles faster on booting client
+* Feature: Set request timeout for Elasticsearch with env var `ELASTICSEARCH_REQUEST_TIMEOUT`
+* Improvement: Apply styles faster on booting client
* Fix: Styles are not applyed on installer
* Fix: Remove last-resort `next()`
@@ -143,6 +143,12 @@ const ENV_VAR_NAME_TO_CONFIG_INFO = {
type: TYPES.STRING,
default: null,
},
+ ELASTICSEARCH_REQUEST_TIMEOUT: {
+ ns: 'crowi',
+ key: 'app:elasticsearchRequestTimeout',
+ type: TYPES.NUMBER,
+ default: 8000, // msec
+ },
SEARCHBOX_SSL_URL: {
ns: 'crowi',
key: 'app:searchboxSslUrl',
@@ -59,7 +59,7 @@ class ElasticsearchDelegator {
this.client = new elasticsearch.Client({
host,
httpAuth,
- requestTimeout: 5000,
+ requestTimeout: this.configManager.getConfig('crowi', 'app:elasticsearchRequestTimeout'),
// log: 'debug',
});
this.indexName = indexName;