From 9de3d73595f5d7acde72e7d5cb48040a902a4136 Mon Sep 17 00:00:00 2001 From: vas3k Date: Sun, 5 Jan 2020 21:36:13 +0100 Subject: [PATCH] Add support for extra high frequency feeds --- boards/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/boards/models.py b/boards/models.py index 39cb87e..98483d3 100644 --- a/boards/models.py +++ b/boards/models.py @@ -176,6 +176,9 @@ class Article(models.Model): elif frequency <= 20: # average frequency — mark today posts return self.created_at > now - timedelta(days=1) + elif frequency >= 100: + # extra high frequency — mark newest posts + return self.created_at > now - timedelta(hours=2) - # high frequency - mark 6-hour old posts + # normal frequency - mark 6-hour old posts return self.created_at > now - timedelta(hours=6)