()
| 920 | } |
| 921 | |
| 922 | async flush(): Promise<void> { |
| 923 | // Cancel pending timer |
| 924 | if (this.flushTimer) { |
| 925 | clearTimeout(this.flushTimer) |
| 926 | this.flushTimer = null |
| 927 | } |
| 928 | // Wait for any in-flight drain to finish |
| 929 | if (this.activeDrain) { |
| 930 | await this.activeDrain |
| 931 | } |
| 932 | // Drain anything remaining in the queues |
| 933 | await this.drainWriteQueue() |
| 934 | |
| 935 | // Wait for non-queue tracked operations (e.g. removeMessageByUuid) |
| 936 | if (this.pendingWriteCount === 0) { |
| 937 | return |
| 938 | } |
| 939 | return new Promise<void>(resolve => { |
| 940 | this.flushResolvers.push(resolve) |
| 941 | }) |
| 942 | } |
| 943 | |
| 944 | /** |
| 945 | * Remove a message from the transcript by UUID. |
no test coverage detected