Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const mediasoup = require('mediasoup');
const config = require('./config');
console.log('mediasoup loaded [version:%s]', mediasoup.version);
let workers = [];
let nextWorkerIndex = 0;
// Start the mediasoup workers
module.exports.initializeWorkers = async () => {
const { logLevel, logTags, rtcMinPort, rtcMaxPort } = config.worker;
console.log('initializeWorkers() creating %d mediasoup workers', config.numWorkers);
for (let i = 0; i < config.numWorkers; ++i) {
const worker = await mediasoup.createWorker({
logLevel, logTags, rtcMinPort, rtcMaxPort
});
worker.once('died', () => {