Adjust memory leak message to be meaningful.
Got this message in the heroku logs: 2015-11-17T04:28:18.549451+00:00 app[web.1]: '[Memory Leak] Memory=' + parseFloat(memory).toFixed(3) + ' Time=' + moment() Converted the line into a variable and threw that instead.
This commit is contained in:
@@ -28,7 +28,10 @@ module.exports = function(server,mongoose) {
|
||||
});*/
|
||||
var memory = os.freemem() / os.totalmem(),
|
||||
memoryHigh = memory < 0.1;
|
||||
if (memoryHigh) throw '[Memory Leak] Memory='+parseFloat(memory).toFixed(3)+' Time='+moment().format();
|
||||
if (memoryHigh) {
|
||||
var memoryLeakMessage = '[Memory Leak] Memory='+parseFloat(memory).toFixed(3)+' Time='+moment().format();
|
||||
throw memoryLeakMessage;
|
||||
}
|
||||
}, mins*60*1000);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user