diff --git a/modules/cache.js b/modules/cache.js index fd0f4fe..b350b8f 100644 --- a/modules/cache.js +++ b/modules/cache.js @@ -25,6 +25,10 @@ function connect_redis() { var exp = {}; +exp.get_redis = function() { + return redis; +}; + // sets the timestamp for +uuid+ to now exp.update_timestamp = function(uuid) { console.log(uuid + " cache: updating timestamp"); diff --git a/test/test.js b/test/test.js index dc121b9..b684115 100644 --- a/test/test.js +++ b/test/test.js @@ -5,7 +5,7 @@ var networking = require('../modules/networking'); var helpers = require('../modules/helpers'); var config = require('../modules/config'); var skins = require('../modules/skins'); -var redis = require("../modules/cache"); +var cache = require("../modules/cache"); var uuids = fs.readFileSync('test/uuids.txt').toString().split("\r\n"); // Get a random UUID in order to prevent rate limiting @@ -13,7 +13,7 @@ var uuid = uuids[Math.floor(Math.random() * uuids.length)]; describe('Avatar Serving', function(){ before(function() { - redis.flushall(); + cache.get_redis().flushall(); }); describe('UUID', function(){ it("should be an invalid uuid", function(done){