Skip to content

Instantly share code, notes, and snippets.

@davidascher
Created October 8, 2010 05:24
Show Gist options
  • Save davidascher/616396 to your computer and use it in GitHub Desktop.
Save davidascher/616396 to your computer and use it in GitHub Desktop.
redis.zrangebyscore(key, pos, "inf", function(error, to_incr) {
var cmds = [];
if (to_incr) {
for (var z = 0; z < to_incr.length; z++) {
cmds.push(['zincrby', 1, to_incr[z]]);
}
}
cmds.push(['zadd', key, pos, slideId]);
redis.multi(cmds).exec(cmds, function(err, results) {
res.writeHead(200, {'Content-Type': 'text/html'});
console.log("returning: " + slide);
res.end(jade.render(slide));
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment