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

attempt to demonstrate RDB failure #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions redis/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,25 @@ 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);
redisClient.hset("hash key", "hashtest 1", "some value", redis.print);
redisClient.hset(["hash key", "hashtest 2", "some other value"], redis.print);

Array.from({length: 10000}).forEach(function(i) {
redisClient.set("key: " + i, "val: " + i, redis.print);
});
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();
});