diff options
author | Cédric Bonhomme <kimble.mandel+bitbucket@gmail.com> | 2015-04-22 11:06:27 +0200 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel+bitbucket@gmail.com> | 2015-04-22 11:06:27 +0200 |
commit | 4fa09afdb7465db6730cb69a9f99279afdb0cf87 (patch) | |
tree | ec221bc4fc68389fb58672cd01b34bf1740c43b0 /pyaggr3g470r/controllers/feed.py | |
parent | Updated NEWS.rst (diff) | |
parent | impacting wosh suppression to controller (diff) | |
download | newspipe-4fa09afdb7465db6730cb69a9f99279afdb0cf87.tar.gz newspipe-4fa09afdb7465db6730cb69a9f99279afdb0cf87.tar.bz2 newspipe-4fa09afdb7465db6730cb69a9f99279afdb0cf87.zip |
Merged in jaesivsm/pyaggr3g470r (pull request #11)
misc improvement in http crawler
Diffstat (limited to 'pyaggr3g470r/controllers/feed.py')
-rw-r--r-- | pyaggr3g470r/controllers/feed.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pyaggr3g470r/controllers/feed.py b/pyaggr3g470r/controllers/feed.py index 8db279ae..82714e39 100644 --- a/pyaggr3g470r/controllers/feed.py +++ b/pyaggr3g470r/controllers/feed.py @@ -27,8 +27,9 @@ from .abstract import AbstractController from pyaggr3g470r.models import Feed logger = logging.getLogger(__name__) -DEFAULT_MAX_ERROR = conf.DEFAULT_MAX_ERROR DEFAULT_LIMIT = 5 +DEFAULT_REFRESH_RATE = 60 +DEFAULT_MAX_ERROR = conf.DEFAULT_MAX_ERROR class FeedController(AbstractController): @@ -42,11 +43,10 @@ class FeedController(AbstractController): .order_by('Feed.last_retrieved') .limit(limit)] - def list_fetchable(self, max_error=DEFAULT_MAX_ERROR, limit=DEFAULT_LIMIT): - from pyaggr3g470r.controllers import UserController + def list_fetchable(self, max_error=DEFAULT_MAX_ERROR, limit=DEFAULT_LIMIT, + refresh_rate=DEFAULT_REFRESH_RATE): 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=refresh_rate) feeds = self.list_late(max_last, max_error, limit) if feeds: self.update({'id__in': [feed.id for feed in feeds]}, |