diff options
author | Andrew Dolgov <[email protected]> | 2007-05-17 08:23:15 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2007-05-17 08:23:15 +0100 |
commit | c1b18749793d11267c938339ca5c7f58b7f3b453 (patch) | |
tree | cd97c0fee505770465c616c78bb6580e0960f0df /viewfeed.js | |
parent | 489ffe5a21687cd5ac3da1e9081b7439a2bcc97b (diff) |
cache_invalidate: fix
Diffstat (limited to 'viewfeed.js')
-rw-r--r-- | viewfeed.js | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/viewfeed.js b/viewfeed.js index c3b28bb80..604af1bae 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; } |