Explorar o código

invalidate cache when skin file is gone

jomo %!s(int64=10) %!d(string=hai) anos
pai
achega
c8dad9dfbb
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      lib/routes/skins.js

+ 7 - 0
lib/routes/skins.js

@@ -53,6 +53,13 @@ module.exports = function(req, callback) {
 
   try {
     helpers.get_skin(rid, userId, function(err, hash, status, image) {
+      if (err) {
+        logging.error(req.id, err);
+        if (err.code === "ENOENT") {
+          // no such file
+          cache.remove_hash(req.id, userId);
+        }
+      }
       if (image) {
         callback({
           status: status,