diff options
| author | Scott Ostler <scottbot9000@gmail.com> | 2011-01-02 17:03:04 -0500 |
|---|---|---|
| committer | Scott Ostler <scottbot9000@gmail.com> | 2011-01-02 17:03:04 -0500 |
| commit | 1b06b06e7e0351dea457b1e96faecd2c705d91c2 (patch) | |
| tree | 8fe8d3b272382df81587d06a7fbdd2d97c939e57 | |
| parent | b56c385a5fcf2baf915308147a593d1411fe2db0 (diff) | |
Sort redis results by score, quickfix until redis broken connections can be fixed
| -rw-r--r-- | src/datalayer.clj | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/datalayer.clj b/src/datalayer.clj index 6b2a466..711dc65 100644 --- a/src/datalayer.clj +++ b/src/datalayer.clj @@ -106,7 +106,9 @@ order by count desc limit ? offset ?") (redis/zrevrange rkey 0 (dec num-popular-dumps))) msg-ids (map maybe-parse-int msg-ids)] (if-not (empty? msg-ids) - (tags/fetch-dumps-by-ids msg-ids viewer-nick)))) + (sort-by + #(* -1 (:count %)) + (tags/fetch-dumps-by-ids msg-ids viewer-nick))))) ;;;; Redis Favscores @@ -147,7 +149,9 @@ order by count desc limit ? offset ?") (redis/with-server redis-server (redis/zrevrange "hall" 0 (dec num-hall-dumps))))] (if-not (empty? ids) - (tags/fetch-dumps-by-ids ids viewer-nick)))) + (sort-by + #(* -1 (:count %)) + (tags/fetch-dumps-by-ids ids viewer-nick))))) ;;;; Message insertion |
