From 416f2513fb76613e6051575f2124d76a531568fe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20K=C3=B6gl?= Date: Sun, 6 Aug 2017 15:47:26 +0000 Subject: [PATCH] Increase frequency of scheduled podcast updates --- mygpo/data/tasks.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mygpo/data/tasks.py b/mygpo/data/tasks.py index 6385b17e..4f34c9ec 100644 --- a/mygpo/data/tasks.py +++ b/mygpo/data/tasks.py @@ -45,8 +45,8 @@ def schedule_updates(interval=UPDATE_INTERVAL): """ Schedules podcast updates that are due within ``interval`` """ now = datetime.utcnow() - # max number of updates to schedule (one per minute) - max_updates = UPDATE_INTERVAL.total_seconds() / 60 + # max number of updates to schedule (one every 10s) + max_updates = UPDATE_INTERVAL.total_seconds() / 20 # fetch podcasts for which an update is due within the next hour podcasts = Podcast.objects.all()\ @@ -61,8 +61,8 @@ def schedule_updates(interval=UPDATE_INTERVAL): def schedule_updates_longest_no_update(): """ Schedule podcasts for update that have not been updated for longest """ - # max number of updates to schedule (one per minute) - max_updates = UPDATE_INTERVAL.total_seconds() / 60 + # max number of updates to schedule (one every 20s) + max_updates = UPDATE_INTERVAL.total_seconds() / 20 podcasts = Podcast.objects.order_by('last_update')[:max_updates] _schedule_updates(podcasts) -- 2.11.4.GIT