fix(ci): Update CI workflows and build config; bump dependencies; code style and TS config fixes
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import { ElsSmartlogDestination, type IStandardLogParams } from './els.classes.smartlogdestination.js';
|
||||
import {
|
||||
ElsSmartlogDestination,
|
||||
type IStandardLogParams,
|
||||
} from './els.classes.smartlogdestination.js';
|
||||
|
||||
export class ElasticScheduler {
|
||||
elasticSearchRef: ElsSmartlogDestination<any>;
|
||||
@@ -16,14 +19,14 @@ export class ElasticScheduler {
|
||||
this.addToStorage(objectArg);
|
||||
this.setRetry();
|
||||
}
|
||||
|
||||
|
||||
public scheduleDoc(logObject: any) {
|
||||
this.addToStorage(logObject);
|
||||
}
|
||||
|
||||
private addToStorage(logObject: any) {
|
||||
this.docsStorage.push(logObject);
|
||||
|
||||
|
||||
// if buffer is full, send logs immediately
|
||||
if (this.docsStorage.length >= this.maxBufferSize) {
|
||||
this.flushLogsToElasticSearch();
|
||||
@@ -33,7 +36,7 @@ export class ElasticScheduler {
|
||||
private flushLogsToElasticSearch() {
|
||||
const oldStorage = this.docsStorage;
|
||||
this.docsStorage = [];
|
||||
|
||||
|
||||
for (let logObject of oldStorage) {
|
||||
this.elasticSearchRef.log(logObject, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user