From 31763becb5fac24eed192b4bb8a01d25c1213dc4 Mon Sep 17 00:00:00 2001 From: Christian Mueller Date: Mon, 31 Mar 2014 11:26:59 +0200 Subject: [PATCH] minor improvements --- src/notehub/storage.clj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/notehub/storage.clj b/src/notehub/storage.clj index 9fa7bf3..4f1f7fc 100644 --- a/src/notehub/storage.clj +++ b/src/notehub/storage.clj @@ -139,8 +139,9 @@ all-notes (map first (partition 2 (redis :hgetall :note))) old-notes (filter #(< (Long/parseLong (redis :hget :published %)) timestamp) all-notes) unpopular-notes (filter #(< (try (Long/parseLong (redis :hget :views %)) - (catch Exception a 0)) N) old-notes)] + (catch Exception a 0)) N) old-notes)] (println "timestamp:" (str (java.util.Date. timestamp))) - (println (count unpopular-notes) "deleted") (doseq [note-id unpopular-notes] - (delete-note note-id))))) + (do (println "deleting" note-id) + (delete-note note-id))) + (println (count unpopular-notes) "deleted"))))