aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/controllers
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2015-03-05 23:36:52 +0100
committerFrançois Schmidts <francois.schmidts@gmail.com>2015-03-05 23:36:52 +0100
commit8c0c605ea0d59355ece2e4f2755acb535ab7b90d (patch)
treea4cbfb3aee4e33420bb7e0b5853e578c278e279b /pyaggr3g470r/controllers
parentset again to 5... (diff)
downloadnewspipe-8c0c605ea0d59355ece2e4f2755acb535ab7b90d.tar.gz
newspipe-8c0c605ea0d59355ece2e4f2755acb535ab7b90d.tar.bz2
newspipe-8c0c605ea0d59355ece2e4f2755acb535ab7b90d.zip
correcting wait counter and reactivating last_retrieved
Diffstat (limited to 'pyaggr3g470r/controllers')
-rw-r--r--pyaggr3g470r/controllers/feed.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/pyaggr3g470r/controllers/feed.py b/pyaggr3g470r/controllers/feed.py
index a3cdcddd..b8e28ee6 100644
--- a/pyaggr3g470r/controllers/feed.py
+++ b/pyaggr3g470r/controllers/feed.py
@@ -2,6 +2,9 @@ from datetime import datetime, timedelta
from .abstract import AbstractController
from pyaggr3g470r.models import Feed
+import logging
+logger = logging.getLogger(__name__)
+
DEFAULT_MAX_ERROR = 3
DEFAULT_LIMIT = 5
@@ -13,11 +16,11 @@ class FeedController(AbstractController):
from pyaggr3g470r.controllers import UserController
now = datetime.now()
user = UserController(self.user_id).get(id=self.user_id)
- #max_last = now - timedelta(minutes=user.refresh_rate or 60)
+ max_last = now - timedelta(minutes=user.refresh_rate or 60)
feeds = [feed for feed in self.read(user_id=self.user_id,
- error_count__lt=max_error, enabled=True).limit(limit)]
- #last_retrieved__lt=max_last).limit(limit)]
- """if feeds:
+ error_count__lt=max_error, enabled=True,
+ last_retrieved__lt=max_last).limit(limit)]
+ if feeds:
self.update({'id__in': [feed.id for feed in feeds]},
- {'last_retrieved': now})"""
+ {'last_retrieved': now})
return feeds
bgstack15