Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow running a server without Redis #63

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions src/server/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import clientConfig from "../client-config.json";
import Currency from "../lib/Currency";

const redisClient = redis.createClient(config.redis);
redisClient.on("error", err => {
console.error("Redis unavailable");
});
const nano = new Nano({ url: config.nodeHost });

async function calculateAccountList() {
Expand Down
3 changes: 3 additions & 0 deletions src/server/helpers/frontiers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import redis from "redis";
import config from "../../../server-config.json";

const redisClient = redis.createClient(config.redis);
redisClient.on("error", err => {
console.error("Redis unavailable");
});
const zcount = promisify(redisClient.zcount.bind(redisClient));
const zrevrange = promisify(redisClient.zrevrange.bind(redisClient));

Expand Down
3 changes: 3 additions & 0 deletions src/server/helpers/tpsCalculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import redis from "redis";
import config from "../../../server-config.json";

const redisClient = redis.createClient(config.redis);
redisClient.on("error", err => {
console.error("Redis unavailable");
});
const zRangeByScore = promisify(redisClient.zrangebyscore.bind(redisClient));

const STORAGE_KEY = `nano-control-panel/${config.redisNamespace ||
Expand Down
3 changes: 3 additions & 0 deletions src/server/networkTps.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import redis from "redis";
import config from "../../server-config.json";

const redisClient = redis.createClient(config.redis);
redisClient.on("error", err => {
console.error("Redis unavailable");
});

const nano = new Nano({ url: config.nodeHost });
const STORAGE_PERIOD = 60 * 60 * 24 * 7 * 1000; // 1 week
Expand Down