mirror of
https://github.com/azures04/crafatar.git
synced 2026-05-06 19:10:38 +02:00
delete hash from redis if file does not exist
This commit is contained in:
@@ -107,6 +107,11 @@ exp.save_hash = function(uuid, hash) {
|
||||
redis.hmset(uuid, "h", hash, "t", time);
|
||||
};
|
||||
|
||||
exp.remove_hash = function(uuid) {
|
||||
logging.log(uuid + " cache: deleting hash");
|
||||
redis.del(uuid.toLowerCase(), "h", "t");
|
||||
};
|
||||
|
||||
// get a details object for +uuid+
|
||||
// {hash: "0123456789abcdef", time: 1414881524512}
|
||||
// null when uuid unkown
|
||||
|
||||
@@ -41,7 +41,7 @@ function store_images(uuid, details, callback) {
|
||||
cache.update_timestamp(uuid, hash);
|
||||
callback(null, hash);
|
||||
} else {
|
||||
if (!exists) {
|
||||
if (details && details.hash && !exists) {
|
||||
logging.warn(uuid + " File was deleted! Downloading again.");
|
||||
} else {
|
||||
// hash has changed
|
||||
|
||||
Reference in New Issue
Block a user