mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-22 07:51:17 +01:00
Add Redis getter
This commit is contained in:
parent
326e733d43
commit
5a4643f334
@ -25,6 +25,10 @@ function connect_redis() {
|
|||||||
|
|
||||||
var exp = {};
|
var exp = {};
|
||||||
|
|
||||||
|
exp.get_redis = function() {
|
||||||
|
return redis;
|
||||||
|
};
|
||||||
|
|
||||||
// sets the timestamp for +uuid+ to now
|
// sets the timestamp for +uuid+ to now
|
||||||
exp.update_timestamp = function(uuid) {
|
exp.update_timestamp = function(uuid) {
|
||||||
console.log(uuid + " cache: updating timestamp");
|
console.log(uuid + " cache: updating timestamp");
|
||||||
|
|||||||
@ -5,7 +5,7 @@ var networking = require('../modules/networking');
|
|||||||
var helpers = require('../modules/helpers');
|
var helpers = require('../modules/helpers');
|
||||||
var config = require('../modules/config');
|
var config = require('../modules/config');
|
||||||
var skins = require('../modules/skins');
|
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");
|
var uuids = fs.readFileSync('test/uuids.txt').toString().split("\r\n");
|
||||||
// Get a random UUID in order to prevent rate limiting
|
// 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(){
|
describe('Avatar Serving', function(){
|
||||||
before(function() {
|
before(function() {
|
||||||
redis.flushall();
|
cache.get_redis().flushall();
|
||||||
});
|
});
|
||||||
describe('UUID', function(){
|
describe('UUID', function(){
|
||||||
it("should be an invalid uuid", function(done){
|
it("should be an invalid uuid", function(done){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user