Skip to content

Commit 05052f6

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 335e5a8 commit 05052f6

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
@@ -495,9 +495,9 @@ export default class DBSQLClient extends EventEmitter implements IDBSQLClient, I
495495
// Cleanup telemetry
496496
if (this.host) {
497497
try {
498-
// Step 1: Flush any pending metrics
498+
// Step 1: Close aggregator (stops timer, completes statements, final flush)
499499
if (this.telemetryAggregator) {
500-
await this.telemetryAggregator.flush();
500+
this.telemetryAggregator.close();
501501
}
502502

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

0 commit comments

Comments
 (0)