浏览代码

log if uuid was too old or not known

jomo 10 年之前
父节点
当前提交
b98cfa8918
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      modules/helpers.js

+ 6 - 2
modules/helpers.js

@@ -79,10 +79,14 @@ exp.get_image_hash = function(uuid, callback) {
     } else {
     } else {
       if (details && details.time + config.local_cache_time * 1000 >= new Date().getTime()) {
       if (details && details.time + config.local_cache_time * 1000 >= new Date().getTime()) {
         // uuid known + recently updated
         // uuid known + recently updated
-        logging.log(uuid + " uuid known & recently updated");
+        logging.log(uuid + " uuid cached & recently updated");
         callback(null, (details.hash ? 1 : 0), details.hash);
         callback(null, (details.hash ? 1 : 0), details.hash);
       } else {
       } else {
-        logging.log(uuid + " uuid not known or too old");
+        if (details) {
+          logging.log(uuid + " uuid cached, but too old");
+        } else {
+          logging.log(uuid + " uuid not cached");
+        }
         store_images(uuid, details, function(err, hash) {
         store_images(uuid, details, function(err, hash) {
           if (err) {
           if (err) {
             callback(err, -1, details && details.hash);
             callback(err, -1, details && details.hash);