Compare commits

..

No commits in common. "master" and "v2.0.8" have entirely different histories.

4 changed files with 7 additions and 15 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@apiclient.xyz/elasticsearch",
"version": "2.0.16",
"version": "2.0.8",
"private": false,
"description": "log to elasticsearch in a kibana compatible format",
"main": "dist_ts/index.js",

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@apiclient.xyz/elasticsearch',
version: '2.0.16',
version: '2.0.8',
description: 'log to elasticsearch in a kibana compatible format'
}

View File

@ -26,7 +26,6 @@ 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;
@ -46,7 +45,7 @@ export class ElasticDoc {
await this.client.indices.create({
index: this.index,
body: {
// mappings,
mappings,
settings: {
// You can define the settings according to your requirements here
},
@ -107,22 +106,15 @@ 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) {
this.fastForward = true;
// Omit the document
return;
} else {
this.fastForward = false;
await this.client.index({
index: this.index,
id: optionsArg.docId,
body: documentBody,
});
}
} else {
this.fastForward = false;
await this.client.index({
index: this.index,
id: optionsArg.docId,
body: documentBody,
});
}
this.sessionDocs.add(optionsArg.docId);
}

View File

@ -54,7 +54,7 @@ export class ElsSmartlogDestination<T> {
return;
}
await this.client.index(
this.client.index(
{
index: indexToUse,
body: {
@ -68,7 +68,7 @@ export class ElsSmartlogDestination<T> {
get logDestination(): ILogDestination {
return {
handleLog: async (smartlogPackageArg: ILogPackage) => {
await this.log(smartlogPackageArg);
this.log(smartlogPackageArg);
},
};
}