Open BeeFox-sys opened 4 years ago
Exact snippet that raised error in my particular case
this.on('data', (data) => {....}
setTimeout(() => {
const property = netModule.Socket.prototype.read;
const isWrapped = property && property.__wrapped === true;
if (isWrapped) {
return this.logger(`Already patched socket read, canceling`);
}
shimmer.wrap(netModule.Socket.prototype, 'read', function (original) {
return function () {
this.on('data', (data) => {
if (typeof data.length === 'number') {
downloadMeter.mark(data.length);
}
});
return original.apply(this, arguments);
};
});
}, 500);
In trying to set up my metrics, I have encounted an error where enabling the network metric results in repeated postings of the MaxListenerExceededWarning error. Here is how I am initalizing the io:
Here is the error:
And here is the traceback:
A prompt solution would be great! Thanks! Node version: v14.5.0 pm2/io version: 4.3.5