From: Andrew Dolgov Date: Thu, 17 May 2007 07:23:15 +0000 (+0100) Subject: cache_invalidate: fix X-Git-Tag: schema_freeze_for_1.2.11~27 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=c1b18749793d11267c938339ca5c7f58b7f3b453;p=tt-rss.git cache_invalidate: fix --- diff --git a/viewfeed.js b/viewfeed.js index c3b28bb8..604af1ba 100644 --- a/viewfeed.js +++ b/viewfeed.js @@ -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; }