Created
February 29, 2012 09:09
-
-
Save guileen/1939341 to your computer and use it in GitHub Desktop.
This code will memory leak, if you restart redis server when the node process is running
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This code will memory leak, if you restart redis server when the node process is running | |
* | |
* @author Gui Lin | |
*/ | |
var redis = require('redis').createClient(); | |
setInterval(function(){ | |
redis.multi() | |
.zrangebyscore('timeup', 0, Date.now()) | |
.zremrangebyscore('timeup', 0, Date.now()) | |
.exec(function(err, data) { | |
if(err) console.log(err.stack); | |
if(data) data = data[0]; | |
}); | |
}, 1); | |
process.on('uncaughtException', function(err) { | |
console.log(err.stack); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment