backend: Filter out egress with status ENDING from the active egress list
This commit is contained in:
parent
f3dfb9769f
commit
6fb353b6b4
@ -5,6 +5,7 @@ import {
|
|||||||
DataPacket_Kind,
|
DataPacket_Kind,
|
||||||
EgressClient,
|
EgressClient,
|
||||||
EgressInfo,
|
EgressInfo,
|
||||||
|
EgressStatus,
|
||||||
EncodedFileOutput,
|
EncodedFileOutput,
|
||||||
ListEgressOptions,
|
ListEgressOptions,
|
||||||
ParticipantInfo,
|
ParticipantInfo,
|
||||||
@ -208,7 +209,12 @@ export class LiveKitService {
|
|||||||
egressId,
|
egressId,
|
||||||
active: true
|
active: true
|
||||||
};
|
};
|
||||||
return await this.egressClient.listEgress(options);
|
const egress = await this.egressClient.listEgress(options);
|
||||||
|
|
||||||
|
// In some cases, the egress list may contain egress that their status is ENDINDG
|
||||||
|
// which means that the egress is still active but it is in the process of stopping.
|
||||||
|
// We need to filter those out.
|
||||||
|
return egress.filter((e) => e.status === EgressStatus.EGRESS_ACTIVE);
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
if (error.message.includes('404')) {
|
if (error.message.includes('404')) {
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user