Skip to content

Commit

Permalink
Bump eslint from 3.19.0 to 4.19.1 (#1504)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored and jcague committed Nov 25, 2019
1 parent 27749a4 commit d546d84
Show file tree
Hide file tree
Showing 43 changed files with 407 additions and 422 deletions.
2 changes: 0 additions & 2 deletions erizo_controller/ROV/rovClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const logger = require('./../common/logger').logger;
const log = logger.getLogger('RovClient');

class NuveProxy {

constructor(amqper) {
this.amqper = amqper;
}
Expand All @@ -31,7 +30,6 @@ class NuveProxy {
getErizoControllers() {
return this.callNuve('getErizoControllers', [], undefined);
}

}

class RovConnection {
Expand Down
6 changes: 3 additions & 3 deletions erizo_controller/ROV/rovMetricsServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ amqper.connect(() => {
rovMetricsGatherer.gatherMetrics().then(() => {
log.debug('Gathered licode metrics');
})
.catch((error) => {
log.error('Error gathering metrics', error);
});
.catch((error) => {
log.error('Error gathering metrics', error);
});
}, config.rov.statsPeriod);
server.get('/metrics', (req, res) => {
res.set('Content-Type', register.contentType);
Expand Down
34 changes: 15 additions & 19 deletions erizo_controller/common/amqper.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const TIMEOUT = 5000;
// This timeout shouldn't be too low because it won't listen to onReady responses from ErizoJS
const REMOVAL_TIMEOUT = 300000;

const map = {}; // {corrID: {fn: callback, to: timeout}}
const map = {}; // {corrID: {fn: callback, to: timeout}}
let connection;
let rpcExc;
let broadcastExc;
Expand All @@ -43,30 +43,27 @@ exports.setPublicRPC = (methods) => {
};

exports.connect = (callback) => {
// Create the amqp connection to rabbitMQ server
// Create the amqp connection to rabbitMQ server
connection = amqp.createConnection(addr);
connection.on('ready', () => {
// Create a direct exchange
// Create a direct exchange
rpcExc = connection.exchange('rpcExchange', { type: 'direct' }, (exchange) => {
try {
log.info(`message: rpcExchange open, exchangeName: ${exchange.name}`);

// Create the queue for receiving messages
// Create the queue for receiving messages
clientQueue = connection.queue('', (q) => {
log.info(`message: clientqueue open, queuename: ${q.name}`);

clientQueue.bind('rpcExchange', clientQueue.name, callback);

clientQueue.subscribe((message) => {
try {
log.debug('message: message received, ' +
`queueName: ${clientQueue.name}`,
log.debug(`message: message received, queueName: ${clientQueue.name}`,
logger.objectToLog(message));

if (map[message.corrID] !== undefined) {
log.debug('message: Callback, ' +
`queueName: ${clientQueue.name}, ` +
`messageType: ${message.type}`,
log.debug(`message: Callback, queueName: ${clientQueue.name}, messageType: ${message.type}`,
logger.objectToLog(message.data));

clearTimeout(map[message.corrID].to);
Expand All @@ -93,12 +90,12 @@ exports.connect = (callback) => {
}
});

// Create a fanout exchange
// Create a fanout exchange
broadcastExc = connection.exchange('broadcastExchange',
{ type: 'topic', autoDelete: false },
(exchange) => {
log.info(`message: exchange open, exchangeName: ${exchange.name}`);
});
{ type: 'topic', autoDelete: false },
(exchange) => {
log.info(`message: exchange open, exchangeName: ${exchange.name}`);
});
});

connection.on('error', (e) => {
Expand All @@ -109,21 +106,20 @@ exports.connect = (callback) => {
};

exports.bind = (id, callback) => {
// Create the queue for receive messages
// Create the queue for receive messages
const q = connection.queue(id, () => {
try {
log.info(`message: queue open, queueName: ${q.name}`);

q.bind('rpcExchange', id, callback);
q.subscribe((message) => {
try {
log.debug('message: message received, ' +
`queueName: ${q.name}, `,
log.debug(`message: message received, queueName: ${q.name}, `,
logger.objectToLog(message));
message.args = message.args || [];
message.args.push((type, result) => {
rpcExc.publish(message.replyTo,
{ data: result, corrID: message.corrID, type });
{ data: result, corrID: message.corrID, type });
});
rpcPublic[message.method](...message.args);
} catch (error) {
Expand All @@ -140,7 +136,7 @@ exports.bind = (id, callback) => {

// Subscribe to 'topic'
exports.bindBroadcast = (id, callback) => {
// Create the queue for receive messages
// Create the queue for receive messages
const q = connection.queue('', () => {
try {
log.info(`message: broadcast queue open, queueName: ${q.name}`);
Expand Down
6 changes: 3 additions & 3 deletions erizo_controller/common/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ exports.logger.objectToLog = (jsonInput) => {
}
const jsonString = JSON.stringify(jsonInput, logJsonReplacer);
return jsonString.replace(/['"]+/g, '')
.replace(/[:]+/g, ': ')
.replace(/[,]+/g, ', ')
.slice(1, -1);
.replace(/[:]+/g, ': ')
.replace(/[,]+/g, ', ')
.slice(1, -1);
};
3 changes: 1 addition & 2 deletions erizo_controller/common/semanticSdp/CandidateInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CandidateInfo {

clone() {
return new CandidateInfo(this.foundation, this.componentId, this.transport, this.priority,
this.address, this.port, this.type, this.generation, this.relAddr, this.relPort);
this.address, this.port, this.type, this.generation, this.relAddr, this.relPort);
}

plain() {
Expand Down Expand Up @@ -73,7 +73,6 @@ class CandidateInfo {
getRelPort() {
return this.relPort;
}

}

module.exports = CandidateInfo;
1 change: 0 additions & 1 deletion erizo_controller/common/semanticSdp/CodecInfo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class CodecInfo {

constructor(codec, type, rate, encoding, params, feedback) {
this.codec = codec;
this.type = type;
Expand Down
1 change: 0 additions & 1 deletion erizo_controller/common/semanticSdp/ICEInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ class ICEInfo {
setEndOfCandidates(endOfCandidates) {
this.endOfCandidates = endOfCandidates;
}

}

ICEInfo.generate = () => {
Expand Down
4 changes: 2 additions & 2 deletions erizo_controller/common/semanticSdp/SDPInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ class SDPInfo {
md.fmtp.push({
payload: codec.getType(),
config: Object.keys(params)
.map(item => item + (params[item] ? `=${params[item]}` : ''))
.join(';'),
.map(item => item + (params[item] ? `=${params[item]}` : ''))
.join(';'),
});
}

Expand Down
4 changes: 2 additions & 2 deletions erizo_controller/erizoAgent/erizoAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const launchErizoJS = (erizo) => {
fs.close(out, (message) => {
if (message) {
log.error('message: error closing log file, ',
`erizoId: ${id}`, 'error:', message);
`erizoId: ${id}`, 'error:', message);
}
});
}
Expand All @@ -173,7 +173,7 @@ const launchErizoJS = (erizo) => {
fs.close(err, (message) => {
if (message) {
log.error('message: error closing log file, ',
`erizoId: ${id}`, 'error:', message);
`erizoId: ${id}`, 'error:', message);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion erizo_controller/erizoController/ecCloudHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ exports.EcCloudHandler = (spec) => {
if (global.config.erizoController.cloudHandlerPolicy) {
// eslint-disable-next-line global-require, import/no-dynamic-require
getErizoAgent = require(`./ch_policies/${
global.config.erizoController.cloudHandlerPolicy}`).getErizoAgent;
global.config.erizoController.cloudHandlerPolicy}`).getErizoAgent;
}

const tryAgain = (count, callback) => {
Expand Down
8 changes: 4 additions & 4 deletions erizo_controller/erizoController/erizoController.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ if (global.config.erizoController.listen_ssl) {
}

server.listen(global.config.erizoController.listen_port);
// eslint-disable-next-line global-require, import/no-extraneous-dependencies
// eslint-disable-next-line global-require, import/no-extraneous-dependencies
const io = require('socket.io').listen(server, { log: false });

io.set('transports', ['websocket']);
Expand Down Expand Up @@ -193,8 +193,8 @@ const addToCloudHandler = (callback) => {
.then(() => true)
.catch((result) => {
if (result === 'whoareyou') {
// TODO: It should try to register again in Cloud Handler.
// But taking into account current rooms, users, ...
// TODO: It should try to register again in Cloud Handler.
// But taking into account current rooms, users, ...
log.error('message: This ErizoController does not exist in cloudHandler ' +
'to avoid unexpected behavior this ErizoController will die');
clearInterval(intervalId);
Expand Down Expand Up @@ -242,7 +242,7 @@ const addToCloudHandler = (callback) => {
log.warn('message: addECToCloudHandler cloudHandler does not respond, ' +
`attemptsLeft: ${attempt}`);

// We'll try it more!
// We'll try it more!
setTimeout(() => {
attempt -= 1;
addECToCloudHandler(attempt);
Expand Down
3 changes: 1 addition & 2 deletions erizo_controller/erizoController/models/Channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class Channel extends events.EventEmitter {
return;
}
log.debug('message: sending buffered messages, number:', buffer.length,
', channelId:', this.id);
', channelId:', this.id);
buffer.forEach((message) => {
log.debug('message: sending buffered message, message:', message, ', channelId:', this.id);
this.sendMessage(...message);
Expand All @@ -155,7 +155,6 @@ class Channel extends events.EventEmitter {
clearTimeout(this.disconnecting);
this.socket.disconnect();
}

}

exports.Channel = Channel;
17 changes: 8 additions & 9 deletions erizo_controller/erizoController/models/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ class Client extends events.EventEmitter {
_publishErizo(id, options, sdp, callback) {
options.mediaConfiguration = this.token.mediaConfiguration;
options.singlePC = this.options.singlePC || false;
log.info('message: addPublisher requested, ' +
log.info('message: addPublisher requested, ',
`streamId: ${id}, clientId: ${this.id}`,
logger.objectToLog(options),
logger.objectToLog(options.attributes));
Expand Down Expand Up @@ -552,9 +552,9 @@ class Client extends events.EventEmitter {

const stream = this.room.streamManager.getPublishedStreamById(options.streamId);
if (stream === undefined) {
log.warn('message: addSubscriber can not be requested, ' +
'reason: publisher not found' +
`streamId: ${options.streamId}, ` +
log.warn('message: addSubscriber can not be requested, ',
'reason: publisher not found',
`streamId: ${options.streamId}, `,
`clientId: ${this.id},`,
logger.objectToLog(options),
logger.objectToLog(options.metadata));
Expand All @@ -573,9 +573,9 @@ class Client extends events.EventEmitter {
client.sendMessage('publish_me', { streamId: options.streamId, peerSocket: this.id });
} else {
if (stream.hasAvSubscriber(this.id)) {
log.warn('message: addSubscriber can not be requested, ' +
'reason: this client is already subscribed' +
`streamId: ${options.streamId}, ` +
log.warn('message: addSubscriber can not be requested, ',
'reason: this client is already subscribed',
`streamId: ${options.streamId}, `,
`clientId: ${this.id},`,
logger.objectToLog(options),
logger.objectToLog(options.metadata));
Expand Down Expand Up @@ -607,7 +607,7 @@ class Client extends events.EventEmitter {
}
return;
} else if (signMess.type === 'failed') {
// TODO: Add Stats event
// TODO: Add Stats event
log.warn('message: addSubscriber ICE Failed, ' +
'state: SUBSCRIBER_FAILED, ' +
`streamId: ${options.streamId}, ` +
Expand Down Expand Up @@ -927,7 +927,6 @@ class Client extends events.EventEmitter {
});
}
}

}

exports.Client = Client;
10 changes: 5 additions & 5 deletions erizo_controller/erizoController/models/Room.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ class Room extends events.EventEmitter {

onRoomControllerEvent(type, evt) {
if (type === 'unpublish') {
// It's supposed to be an integer.
// It's supposed to be an integer.
const streamId = parseInt(evt, 10);
log.warn('message: Triggering removal of stream ' +
'because of ErizoJS timeout, ' +
`streamId: ${streamId}`);
this.sendMessage('onRemoveStream', { id: streamId });
// remove clients and streams?
// remove clients and streams?
}
}

Expand All @@ -87,9 +87,9 @@ class Room extends events.EventEmitter {
sendMessage(method, args) {
this.forEachClient((client) => {
log.debug('message: sendMsgToRoom,',
'clientId:', client.id, ',',
'roomId:', this.id, ', ',
logger.objectToLog(method));
'clientId:', client.id, ',',
'roomId:', this.id, ', ',
logger.objectToLog(method));
client.sendMessage(method, args);
});
}
Expand Down
Loading

0 comments on commit d546d84

Please sign in to comment.