aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/controllers/feed.py
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel+bitbucket@gmail.com>2015-04-22 11:06:27 +0200
committerCédric Bonhomme <kimble.mandel+bitbucket@gmail.com>2015-04-22 11:06:27 +0200
commit4fa09afdb7465db6730cb69a9f99279afdb0cf87 (patch)
treeec221bc4fc68389fb58672cd01b34bf1740c43b0 /pyaggr3g470r/controllers/feed.py
parentUpdated NEWS.rst (diff)
parentimpacting wosh suppression to controller (diff)
downloadnewspipe-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.py10
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]},
bgstack15