mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-21 23:41:18 +01:00
high scalability!!! using '.' instead of 'null' string
This commit is contained in:
parent
04c167f5aa
commit
0c73d39c79
@ -67,6 +67,8 @@ exp.update_timestamp = function(uuid, hash) {
|
|||||||
exp.save_hash = function(uuid, hash) {
|
exp.save_hash = function(uuid, hash) {
|
||||||
logging.log(uuid + " cache: saving hash");
|
logging.log(uuid + " cache: saving hash");
|
||||||
var time = new Date().getTime();
|
var time = new Date().getTime();
|
||||||
|
// store shorter null byte instead of "null"
|
||||||
|
hash = hash || ".";
|
||||||
// store uuid in lower case if not null
|
// store uuid in lower case if not null
|
||||||
uuid = uuid && uuid.toLowerCase();
|
uuid = uuid && uuid.toLowerCase();
|
||||||
redis.hmset(uuid, "h", hash, "t", time);
|
redis.hmset(uuid, "h", hash, "t", time);
|
||||||
@ -80,7 +82,7 @@ exp.get_details = function(uuid, callback) {
|
|||||||
var details = null;
|
var details = null;
|
||||||
if (data) {
|
if (data) {
|
||||||
details = {
|
details = {
|
||||||
hash: (data.h == "null" ? null : data.h),
|
hash: (data.h == "." ? null : data.h),
|
||||||
time: Number(data.t)
|
time: Number(data.t)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user