From 9f699e46b53061506134b6ca82b3ed9454d6ede6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Sun, 15 Dec 2013 22:50:28 -0500 Subject: [PATCH] Reset feed_parsing_error column when successful --- model.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/model.php b/model.php index 1926614..55e57c0 100644 --- a/model.php +++ b/model.php @@ -330,6 +330,7 @@ function update_feed($feed_id) if ($result !== false) { + update_feed_parsing_error($feed_id, 0); update_feed_cache_infos($feed_id, $resource->getLastModified(), $resource->getEtag()); update_items($feed_id, $result->items, $parser->grabber); write_debug(); @@ -338,8 +339,7 @@ function update_feed($feed_id) } } - \PicoTools\singleton('db')->table('feeds')->eq('id', $feed_id)->save(array('parsing_error' => 1)); - + update_feed_parsing_error($feed_id, 1); write_debug(); return false; @@ -399,6 +399,12 @@ function get_empty_feeds() } +function update_feed_parsing_error($feed_id, $value) +{ + \PicoTools\singleton('db')->table('feeds')->eq('id', $feed_id)->save(array('parsing_error' => $value)); +} + + function update_feed_last_checked($feed_id) { \PicoTools\singleton('db')