style(gateway,backend): clear all biome warnings (no warnings left behind)
Address every remaining biome lint/format warning across both services so the codebase ships warning-free: - textCacheStore: drop unused deleteExpiredQdrantPoints import; hash image cache key (sha256[:32]) so long/base64 URLs no longer blow the text_analysis_cache PK B-tree 8191-byte index (was aborting the media analysis lock INSERT). - bootstrap: drop unused unhandledRejection promise param. - moderationOrchestrator: drop unused destructure at L197. - mediaDownloader / textBatchProcessor / transmitter: replace non-null assertions with proper null guards (stickerName ?? '', urlImages.get guard, backpressureQueue.shift guard). - backend utils: throw lastError ?? fallback instead of lastError!. - message-capture: remove unused (retentionDb), (moderationActionsDb, reviewsDb); simplify renderDiscordMentions guard to optional chain. - transmitter: remove dead write-only field + its assignments. No behavior change beyond the cache-key hashing (now deterministic fixed-length) and the intentional null-safety guards.
This commit is contained in:
1 parent
c590a8be27
commit
416c690ebc
11 files changed
+12
-17
No files matched your search
@@ -27,8 +27,6 @@ export class VoiceTransmitter {
|
||||
private gate = Promise.resolve();
|
||||
/** Set true before sending SIGTERM so exit handler knows it's intentional */
|
||||
private _expectedExit = false;
|
||||
/** True while the underlying stream is in a drain state (backpressure) */
|
||||
private draining = false;
|
||||
|
||||
/**
|
||||
* Start listening for PCM audio data from Redis and stream to Discord
|
||||
@@ -179,15 +177,13 @@ export class VoiceTransmitter {
|
||||
const canContinue = stream.write(pcmBuffer);
|
||||
// Backpressure: queue until drain
|
||||
if (!canContinue) {
|
||||
this.draining = true;
|
||||
stream.once("drain", () => {
|
||||
this.draining = false;
|
||||
// Re-acquire stream reference (could have been replaced by restart)
|
||||
const currentStream = this.pcmStream;
|
||||
if (!currentStream || !this.isActive) return;
|
||||
// Flush queued chunks
|
||||
while (this.backpressureQueue.length > 0) {
|
||||
const queued = this.backpressureQueue.shift()!;
|
||||
const queued = this.backpressureQueue.shift();
|
||||
if (!queued) break;
|
||||
try {
|
||||
if (!currentStream.write(queued)) break;
|
||||
} catch (err) {
|
||||
@@ -237,7 +233,6 @@ export class VoiceTransmitter {
|
||||
this.isActive = false;
|
||||
|
||||
this.backpressureQueue = [];
|
||||
this.draining = false;
|
||||
|
||||
if (this.pcmStream) {
|
||||
this.pcmStream.removeAllListeners("drain");
|
||||
|
||||
Reference in new issue
Block a user