Skip to content

Commit 228c2be

Browse files
committed
Fix telemetry aggregator cleanup in client close
Changed from flush() to close() to ensure: - Periodic flush timer is stopped - Incomplete statements are finalized - Final flush is performed Previously, only flush() was called which left the timer running and didn't complete remaining statements.
1 parent c2daa4b commit 228c2be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/DBSQLClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,9 +494,9 @@ export default class DBSQLClient extends EventEmitter implements IDBSQLClient, I
494494
// Cleanup telemetry
495495
if (this.host) {
496496
try {
497-
// Step 1: Flush any pending metrics
497+
// Step 1: Close aggregator (stops timer, completes statements, final flush)
498498
if (this.telemetryAggregator) {
499-
await this.telemetryAggregator.flush();
499+
this.telemetryAggregator.close();
500500
}
501501

502502
// Step 2: Release telemetry client (decrements ref count, closes if last)

0 commit comments

Comments
 (0)