diff --git a/src/storage/elasticsearch/elasticsearch.ts b/src/storage/elasticsearch/elasticsearch.ts index 9e2acf22..50c4ea67 100644 --- a/src/storage/elasticsearch/elasticsearch.ts +++ b/src/storage/elasticsearch/elasticsearch.ts @@ -369,7 +369,7 @@ export class Elasticsearch implements Database { public async bulkUpdated(bulk: Bulk): Promise { // if our es instance is not ready yet, we cannot serve this request if (!this.ready) { - throw new Error('Elasticsearch not ready'); + throw new Error('No connection to elasticsearch established yet.'); } // index name for elasticsearch @@ -463,7 +463,7 @@ export class Elasticsearch implements Database { throw new Error('Monitoring is defined, but MailQueue is undefined. A MailQueue is obligatory for monitoring.'); } // read all watches and schedule searches on the client - Monitoring.setUp(monitoringConfiguration, this.client, this.mailQueue); + await Monitoring.setUp(monitoringConfiguration, this.client, this.mailQueue); } return this.getAliasMap(); @@ -548,16 +548,10 @@ export class Elasticsearch implements Database { throw new Error('Database is undefined. You have to configure the query build'); } - // check if the database version is defined and in the expected format - if (typeof this.config.internal.database.version === 'undefined' - || typeof this.config.internal.database.version !== 'string') { - throw new Error('Database version is malformed. Check your config file'); - } - // create elasticsearch configuration out of data from database configuration const esConfig: ElasticsearchConfig = { name: this.config.internal.database.name as 'elasticsearch', - version: this.config.internal.database.version, + version: this.config.internal.database.version as string, }; if (typeof this.config.internal.database.query !== 'undefined') {