1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Small style changes

This commit is contained in:
Ruben Bridgewater
2015-10-04 21:44:52 +02:00
parent 2fc54ece57
commit 7922d4eb85
28 changed files with 386 additions and 390 deletions

View File

@@ -1,6 +1,6 @@
'use strict';
var redis = require("../index"),
var redis = require('../index'),
client = redis.createClient(null, null, {
command_queue_high_water: 5,
command_queue_low_water: 1
@@ -9,26 +9,26 @@ var redis = require("../index"),
function op() {
if (remaining_ops <= 0) {
console.error("Finished.");
console.error('Finished.');
process.exit(0);
}
remaining_ops--;
if (client.hset("test hash", "val " + remaining_ops, remaining_ops) === false) {
console.log("Pausing at " + remaining_ops);
if (client.hset('test hash', 'val ' + remaining_ops, remaining_ops) === false) {
console.log('Pausing at ' + remaining_ops);
paused = true;
} else {
process.nextTick(op);
}
}
client.on("drain", function () {
client.on('drain', function () {
if (paused) {
console.log("Resuming at " + remaining_ops);
console.log('Resuming at ' + remaining_ops);
paused = false;
process.nextTick(op);
} else {
console.log("Got drain while not paused at " + remaining_ops);
console.log('Got drain while not paused at ' + remaining_ops);
}
});