add a shutdown method to buffer service

This commit is contained in:
Alex Holliday committed 2026-06-24 11:58:32 -07:00
1 parent 2b9ff52f6b
commit 8579edd56e
1 file changed
+10
+10
View File
@@ -13,6 +13,7 @@ export interface IBufferService {
scheduleNextFlush(): void;
flushBuffer(): Promise<void>;
flushGeoBuffer(): Promise<void>;
shutdown(): Promise<void>;
}
export class BufferService implements IBufferService {
@@ -152,4 +153,13 @@ export class BufferService implements IBufferService {
this.geoBuffer = [];
}
}
async shutdown() {
if (this.bufferTimer) {
clearTimeout(this.bufferTimer);
this.bufferTimer = null;
}
await this.flushBuffer();
await this.flushGeoBuffer();
}
}