From e44365b674aace96506a9ac5110ae35fb28dc320 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Tue, 29 Aug 2023 11:48:32 +0200 Subject: [PATCH] fix(core): update --- ts/00_commitinfo_data.ts | 2 +- ts/els.classes.elasticdoc.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 44989ae..ab320fa 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@apiclient.xyz/elasticsearch', - version: '2.0.11', + version: '2.0.12', description: 'log to elasticsearch in a kibana compatible format' } diff --git a/ts/els.classes.elasticdoc.ts b/ts/els.classes.elasticdoc.ts index bf8a536..351c6f9 100644 --- a/ts/els.classes.elasticdoc.ts +++ b/ts/els.classes.elasticdoc.ts @@ -26,6 +26,7 @@ export class ElasticDoc { private indexInitialized: boolean = false; private latestTimestamp: string | null = null; // Store the latest timestamp private onlyNew: boolean = false; // Whether to only pipe new docs + public fastForward: boolean = false; // Whether to fast forward to the latest timestamp private BATCH_SIZE = 1000; @@ -106,8 +107,9 @@ export class ElasticDoc { // If 'onlyNew' is true, compare the document timestamp with the latest timestamp if (this.onlyNew) { if (this.latestTimestamp && optionsArg.timestamp <= this.latestTimestamp) { - // Omit the document + this.fastForward = true; } else { + this.fastForward = false; await this.client.index({ index: this.index, id: optionsArg.docId,