Skip to content

Commit

Permalink
bugfix: pass meta to existsIndexTemplate method from OS API
Browse files Browse the repository at this point in the history
Signed-off-by: barrancojared
<[email protected]>
  • Loading branch information
jaredbarranco committed Jan 3, 2025
1 parent 22ff869 commit 7a53380
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bulk_writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ const BulkWriter = function BulkWriter(transport, client, options) {
this.bulk = []; // bulk to be flushed
this.running = false;
this.timer = false;
this.connected = false;
debug('created', this);
};

BulkWriter.prototype.start = function start() {
this.checkEsConnection(this.retryLimit);
this.checkEsConnection(this.retryLimit).finally(() => {
this.connected = true;
});
debug('started');
};

Expand Down Expand Up @@ -104,7 +107,7 @@ BulkWriter.prototype.append = function append(index, doc) {
attempts: 0,
});
// resume the buffering process
if (!this.running) {
if (!this.running && this.connected) {
this.running = true;
this.tick();
}
Expand Down Expand Up @@ -251,7 +254,7 @@ BulkWriter.prototype.ensureIndexTemplate = function ensureIndexTemplate(fulfill,
name: 'template_' + templateName,
};
debug('Checking tpl name', tmplCheckMessage);
thiz.client.indices.existsIndexTemplate(tmplCheckMessage).then(
thiz.client.indices.existsIndexTemplate(tmplCheckMessage, { meta: true }).then(
(res) => {
if (res.statusCode && res.statusCode === 404) {
const tmplMessage = {
Expand Down

0 comments on commit 7a53380

Please sign in to comment.