LINXD-2209: Check queue length
This commit is contained in:
parent
b834016dcb
commit
782b749ea3
2
.env
2
.env
@ -1,3 +1,3 @@
|
|||||||
PORT=3000
|
PORT=3001
|
||||||
IP=0.0.0.0 # Listening IPv4 or IPv6.
|
IP=0.0.0.0 # Listening IPv4 or IPv6.
|
||||||
ANNOUNCED_IP=185.8.154.190 # Announced IPv4 or IPv6 (useful when running mediasoup behind NAT with private IP).
|
ANNOUNCED_IP=185.8.154.190 # Announced IPv4 or IPv6 (useful when running mediasoup behind NAT with private IP).
|
||||||
|
2
app.js
2
app.js
@ -118,12 +118,14 @@ const mediaCodecs = [
|
|||||||
}
|
}
|
||||||
|
|
||||||
setInterval(async () => {
|
setInterval(async () => {
|
||||||
|
if (queue.length > 0) {
|
||||||
const { callId, callback } = queue.shift();
|
const { callId, callback } = queue.shift();
|
||||||
if (router[callId] === undefined) {
|
if (router[callId] === undefined) {
|
||||||
router[callId] = await worker.createRouter({ mediaCodecs })
|
router[callId] = await worker.createRouter({ mediaCodecs })
|
||||||
console.log(`[createRoom] Router ID: ${router[callId].id}`)
|
console.log(`[createRoom] Router ID: ${router[callId].id}`)
|
||||||
getRtpCapabilities(callId, callback)
|
getRtpCapabilities(callId, callback)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
|
||||||
peers.on('connection', async socket => {
|
peers.on('connection', async socket => {
|
||||||
|
Loading…
Reference in New Issue
Block a user