mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
More tweaking to feed refresh rate: Higher volume = more fetches
This commit is contained in:
parent
80bdb79bd9
commit
7212778d7c
1 changed files with 7 additions and 4 deletions
|
@ -320,15 +320,18 @@ class Feed(models.Model):
|
|||
# Use stories per month to calculate next feed update
|
||||
updates_per_day = max(30, self.stories_per_month) / 30.0
|
||||
# 1 update per day = 12 hours
|
||||
# > 1 update per day = 30 minutes
|
||||
minutes_to_next_update = 30
|
||||
# > 1 update per day:
|
||||
# 2 updates = 1.5 hours
|
||||
# 4 updates = 45 minutes
|
||||
# 10 updates = 18 minutes
|
||||
minutes_to_next_update = 12 * 60 / (updates_per_day * 4)
|
||||
if updates_per_day <= 1:
|
||||
minutes_to_next_update = 60 * 12
|
||||
random_factor = random.randint(0,int(minutes_to_next_update/4))
|
||||
slow_punishment = 0
|
||||
random_factor = random.randint(0,int(minutes_to_next_update/6))
|
||||
# 6 hours / subscribers. Lots of subscribers = lots of updates
|
||||
subscriber_bonus = 6 * 60 / max(1, self.num_subscribers)
|
||||
|
||||
slow_punishment = 0
|
||||
if 30 <= self.last_load_time < 60:
|
||||
slow_punishment = self.last_load_time
|
||||
elif 60 <= self.last_load_time < 100:
|
||||
|
|
Loading…
Add table
Reference in a new issue