summaryrefslogtreecommitdiff
path: root/src/site.clj
diff options
context:
space:
mode:
Diffstat (limited to 'src/site.clj')
-rw-r--r--src/site.clj7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/site.clj b/src/site.clj
index 6668fc7..87f9734 100644
--- a/src/site.clj
+++ b/src/site.clj
@@ -210,12 +210,14 @@
(try
(let [msg-ids (re-seq #"\w+"
(slurp frontpage-posts-path))
- msgs (datalayer/fetch-messages-by-id (shuffle msg-ids))]
+ msgs (datalayer/fetch-messages-by-id msg-ids)]
(for [m msgs]
(assoc m :score (hall-score (:message_id m)))))
(catch Exception e (println e) [])))
12000
nil))
+(def num-frontpage-dumps 20)
+
(defn front-page
([session] (front-page session (format-yyyymmdd (Date.))))
([session dt-str]
@@ -227,7 +229,8 @@
dumps (map process-message-for-output
(if (:nick session)
(fetch-redis-daily-hall cur-date 0 20 (:user_id session))
- (poll frontpage-posts-agent)))]
+ (take num-frontpage-dumps
+ (shuffle (poll frontpage-posts-agent)))))]
(.setAttribute st "dumps" dumps)
(if-not (.after next-date today)
(.setAttribute st "next_date" (format-yyyymmdd next-date)))