|
@@ -99,7 +99,7 @@ exp.info = function(callback) {
|
|
exp.update_timestamp = function(rid, userId, hash, temp, callback) {
|
|
exp.update_timestamp = function(rid, userId, hash, temp, callback) {
|
|
logging.log(rid, "cache: updating timestamp");
|
|
logging.log(rid, "cache: updating timestamp");
|
|
var sub = temp ? (config.local_cache_time - 60) : 0;
|
|
var sub = temp ? (config.local_cache_time - 60) : 0;
|
|
- var time = new Date().getTime() - sub;
|
|
|
|
|
|
+ var time = Date.now() - sub;
|
|
// store userId in lower case if not null
|
|
// store userId in lower case if not null
|
|
userId = userId && userId.toLowerCase();
|
|
userId = userId && userId.toLowerCase();
|
|
redis.hmset(userId, "t", time, function(err) {
|
|
redis.hmset(userId, "t", time, function(err) {
|
|
@@ -114,7 +114,7 @@ exp.update_timestamp = function(rid, userId, hash, temp, callback) {
|
|
// +callback+ contans error
|
|
// +callback+ contans error
|
|
exp.save_hash = function(rid, userId, skin_hash, cape_hash, callback) {
|
|
exp.save_hash = function(rid, userId, skin_hash, cape_hash, callback) {
|
|
logging.log(rid, "cache: saving skin:" + skin_hash + " cape:" + cape_hash);
|
|
logging.log(rid, "cache: saving skin:" + skin_hash + " cape:" + cape_hash);
|
|
- var time = new Date().getTime();
|
|
|
|
|
|
+ var time = Date.now();
|
|
// store shorter null byte instead of "null"
|
|
// store shorter null byte instead of "null"
|
|
skin_hash = (skin_hash === null ? "" : skin_hash);
|
|
skin_hash = (skin_hash === null ? "" : skin_hash);
|
|
cape_hash = (cape_hash === null ? "" : cape_hash);
|
|
cape_hash = (cape_hash === null ? "" : cape_hash);
|