]> git.wh0rd.org Git - tt-rss.git/commitdiff
cache_invalidate: fix
authorAndrew Dolgov <fox@madoka.spb.ru>
Thu, 17 May 2007 07:23:15 +0000 (08:23 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Thu, 17 May 2007 07:23:15 +0000 (08:23 +0100)
viewfeed.js

index c3b28bb80c0817018aa3c48045a2834489f15160..604af1bae02c020a114787ca3933c0a83fbf27d7 100644 (file)
@@ -879,13 +879,20 @@ function cache_expire() {
 
 function cache_invalidate(id) {
        var i = 0
-       
-       while (i < article_cache.length) {
-               if (article_cache[i]["id"] == id) {
-                       article_cache.remove(i);
-                       return true;
+
+       try {   
+
+               while (i < article_cache.length) {
+                       if (article_cache[i]["id"] == id) {
+                               debug("cache_invalidate: removed id " + id);
+                               article_cache.splice(i, 1);
+                               return true;
+                       }
+                       i++;
                }
-               i++;
+               debug("cache_invalidate: id not found: " + id);
+               return false;
+       } catch (e) {
+               exception_error("cache_invalidate", e);
        }
-       return false;
 }