Fix batch flush to Clearcut (#1337)

Co-authored-by: Scott Densmore <scottdensmore@mac.com>
This commit is contained in:
Jerop Kipruto
2025-06-23 17:12:58 -04:00
committed by GitHub
parent d2ae7af487
commit 4d88054d35

View File

@@ -79,7 +79,6 @@ export class ClearcutLogger {
} }
this.flushToClearcut(); this.flushToClearcut();
this.last_flush_time = Date.now();
} }
flushToClearcut(): Promise<LogResponse> { flushToClearcut(): Promise<LogResponse> {
@@ -121,6 +120,7 @@ export class ClearcutLogger {
}).then((buf: Buffer) => { }).then((buf: Buffer) => {
try { try {
this.events.length = 0; this.events.length = 0;
this.last_flush_time = Date.now();
return this.decodeLogResponse(buf) || {}; return this.decodeLogResponse(buf) || {};
} catch (error: unknown) { } catch (error: unknown) {
console.error('Error flushing log events:', error); console.error('Error flushing log events:', error);