Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
Update client.js
Browse files Browse the repository at this point in the history
  • Loading branch information
brysgo committed Dec 13, 2020
1 parent 42272d7 commit ac32ceb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions redis/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const redis = require("redis");
redisClient = redis.createClient(process.env.REDIS_PORT, process.env.REDIS_HOST);

redisClient.on("error", function(err) {
console.log("Error " + err);
throw new Error("Error " + err);
});

redisClient.set("string key", "string val", redis.print);
Expand All @@ -17,12 +17,12 @@ Array.from({length: 10000}).forEach(function(i) {
setTimeout(function() {
Array.from({length: 10000}).forEach(function(i) {
redisClient.set("key: " + i, "val: " + i, redis.print);
redisClient.quit();
});
}, 120000);
redisClient.hkeys("hash key", function (err, replies) {
console.log(replies.length + " replies:");
replies.forEach(function (reply, i) {
console.log(" " + i + ": " + reply);
});
redisClient.quit();
});

0 comments on commit ac32ceb

Please sign in to comment.