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

Commit ac32ceb

Browse files
committed
Update client.js
1 parent 42272d7 commit ac32ceb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

redis/client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const redis = require("redis");
44
redisClient = redis.createClient(process.env.REDIS_PORT, process.env.REDIS_HOST);
55

66
redisClient.on("error", function(err) {
7-
console.log("Error " + err);
7+
throw new Error("Error " + err);
88
});
99

1010
redisClient.set("string key", "string val", redis.print);
@@ -17,12 +17,12 @@ Array.from({length: 10000}).forEach(function(i) {
1717
setTimeout(function() {
1818
Array.from({length: 10000}).forEach(function(i) {
1919
redisClient.set("key: " + i, "val: " + i, redis.print);
20+
redisClient.quit();
2021
});
2122
}, 120000);
2223
redisClient.hkeys("hash key", function (err, replies) {
2324
console.log(replies.length + " replies:");
2425
replies.forEach(function (reply, i) {
2526
console.log(" " + i + ": " + reply);
2627
});
27-
redisClient.quit();
2828
});

0 commit comments

Comments
 (0)