mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 19:56:23 +00:00
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:
parent
29c4e21b67
commit
8b7f50bfcf
1 changed files with 4 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue