aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2015-05-27 10:22:35 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2015-05-27 10:22:35 +0200
commit15a79c55895c6b34704f8ee332c16f576ef4f37a (patch)
tree4621f706f115a1023de871a5fff9f7c52b5a65ff
parentThe web server should run on 0.0.0.0 for Vagrant. (diff)
downloadnewspipe-15a79c55895c6b34704f8ee332c16f576ef4f37a.tar.gz
newspipe-15a79c55895c6b34704f8ee332c16f576ef4f37a.tar.bz2
newspipe-15a79c55895c6b34704f8ee332c16f576ef4f37a.zip
No need to set feed.enabled in the asyncio crawler. Just to increase the counter.
-rw-r--r--pyaggr3g470r/crawler.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/pyaggr3g470r/crawler.py b/pyaggr3g470r/crawler.py
index e153c1ab..e5a7966f 100644
--- a/pyaggr3g470r/crawler.py
+++ b/pyaggr3g470r/crawler.py
@@ -71,8 +71,6 @@ def parse_feed(user, feed):
finally:
if data is None:
feed.error_count += 1
- if feed.error_count >= conf.DEFAULT_MAX_ERROR:
- feed.enabled = False
db.session.commit()
return
@@ -81,8 +79,6 @@ def parse_feed(user, feed):
#logger.error(a_feed['bozo_exception'])
feed.last_error = str(a_feed['bozo_exception'])
feed.error_count += 1
- if feed.error_count >= conf.DEFAULT_MAX_ERROR:
- feed.enabled = False
db.session.commit()
if a_feed['entries'] == []:
return
@@ -235,7 +231,9 @@ def retrieve_feed(user, feed_id=None):
# Get the list of feeds to fetch
user = User.query.filter(User.email == user.email).first()
- feeds = [feed for feed in user.feeds if feed.enabled]
+ feeds = [feed for feed in user.feeds if
+ feed.error_count <= conf.DEFAULT_MAX_ERROR and \
+ feed.enabled]
if feed_id is not None:
feeds = [feed for feed in feeds if feed.id == feed_id]
bgstack15