Skip to content

Commit

Permalink
utilize detectNew() in middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
aheckmann committed Sep 8, 2011
1 parent 748210e commit 58d3e51
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,10 @@ exports.middleware = function gleakMiddleware (stream, format) {
}
}

var known = [];
setTimeout(print, 1000);

function print () {
g.detect().forEach(function (leak) {
if (~known.indexOf(leak)) return;
known.push(leak);
g.detectNew().forEach(function (leak) {
stream.write(format.replace(/%s/, leak) + '\n');
});
}
Expand Down

0 comments on commit 58d3e51

Please sign in to comment.