fix: initialize release variable to prevent potential errors in start/stop methods
Deploy to VPS / deploy (push) Successful in 2m9s

This commit is contained in:
asepharyana
2026-07-26 14:30:36 +07:00
parent 0a6a9fd982
commit 12b23b4632
@@ -28,6 +28,9 @@ export class VoiceTransmitter {
/** Set true before sending SIGTERM so exit handler knows it's intentional */
private _expectedExit = false;
/** True while backpressure drain is in progress */
private draining = false;
/**
* Start listening for PCM audio data from Redis and stream to Discord
*/
@@ -36,7 +39,7 @@ export class VoiceTransmitter {
// Serialise with stop() so concurrent start+stop don't tear each other down
const prev = this.gate;
let release: () => void;
let release: () => void = () => {};
this.gate = new Promise<void>((r) => {
release = r;
});
@@ -187,7 +190,7 @@ export class VoiceTransmitter {
// Serialise with start() so concurrent start+stop don't tear each other down
const prev = this.gate;
let release: () => void;
let release: () => void = () => {};
this.gate = new Promise<void>((r) => {
release = r;
});