add logger to handler
This commit is contained in:
parent
654f3c9c3c
commit
0aa52c488a
@ -23,6 +23,7 @@ const handler = (client, message) => {
|
|||||||
throw new Error('Peer dead');
|
throw new Error('Peer dead');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
logger.error(e);
|
||||||
// This happens when a peer disconnects without closing connections and
|
// This happens when a peer disconnects without closing connections and
|
||||||
// the associated WebSocket has not closed.
|
// the associated WebSocket has not closed.
|
||||||
// Tell other side to stop trying.
|
// Tell other side to stop trying.
|
||||||
@ -42,8 +43,10 @@ const handler = (client, message) => {
|
|||||||
// Wait for this client to connect/reconnect (XHR) for important
|
// Wait for this client to connect/reconnect (XHR) for important
|
||||||
// messages.
|
// messages.
|
||||||
if (type !== MessageType.LEAVE && type !== MessageType.EXPIRE && dstId) {
|
if (type !== MessageType.LEAVE && type !== MessageType.EXPIRE && dstId) {
|
||||||
|
logger.debug(`[HANDLER] dst client ${dstId} not found, add msg to queue`);
|
||||||
realm.addMessageToQueue(dstId, message);
|
realm.addMessageToQueue(dstId, message);
|
||||||
} else if (type === MessageType.LEAVE && !dstId) {
|
} else if (type === MessageType.LEAVE && !dstId) {
|
||||||
|
logger.debug(`[HANDLER] remove client ${srcId}`);
|
||||||
realm.removeClientById(srcId);
|
realm.removeClientById(srcId);
|
||||||
} else {
|
} else {
|
||||||
// Unavailable destination specified with message LEAVE or EXPIRE
|
// Unavailable destination specified with message LEAVE or EXPIRE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user