fix: initialize release variable to prevent potential errors in start/stop methods
Deploy to VPS / deploy (push) Successful in 2m9s
Deploy to VPS / deploy (push) Successful in 2m9s
This commit is contained in:
@@ -28,6 +28,9 @@ export class VoiceTransmitter {
|
|||||||
/** Set true before sending SIGTERM so exit handler knows it's intentional */
|
/** Set true before sending SIGTERM so exit handler knows it's intentional */
|
||||||
private _expectedExit = false;
|
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
|
* 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
|
// Serialise with stop() so concurrent start+stop don't tear each other down
|
||||||
const prev = this.gate;
|
const prev = this.gate;
|
||||||
let release: () => void;
|
let release: () => void = () => {};
|
||||||
this.gate = new Promise<void>((r) => {
|
this.gate = new Promise<void>((r) => {
|
||||||
release = r;
|
release = r;
|
||||||
});
|
});
|
||||||
@@ -187,7 +190,7 @@ export class VoiceTransmitter {
|
|||||||
|
|
||||||
// Serialise with start() so concurrent start+stop don't tear each other down
|
// Serialise with start() so concurrent start+stop don't tear each other down
|
||||||
const prev = this.gate;
|
const prev = this.gate;
|
||||||
let release: () => void;
|
let release: () => void = () => {};
|
||||||
this.gate = new Promise<void>((r) => {
|
this.gate = new Promise<void>((r) => {
|
||||||
release = r;
|
release = r;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user