From d1c15fe5fa8d5aac6a7ca056e79ca8872971a9d9 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Tue, 20 Feb 2018 00:04:08 -0300 Subject: Even more test --- src/clj/queue_api/db/core.clj | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/clj/queue_api/db') diff --git a/src/clj/queue_api/db/core.clj b/src/clj/queue_api/db/core.clj index f40548c..faa4d65 100644 --- a/src/clj/queue_api/db/core.clj +++ b/src/clj/queue_api/db/core.clj @@ -78,14 +78,11 @@ "Get how many jobs a agent (`id`) has performed aggregated by type" [id] (let [jobs (agent-jobs id :completed)] - (->> (reduce (fn [l r] - (let [t (:job/type r)] - (if (nil? (get l t)) - (conj l {t 1}) - (conj l {t (inc (get l t))})))) {} jobs) - (map (fn [x] - {:type (first x) - :jobs (last x)}))))) + (reduce (fn [l r] + (let [t (:job/type r)] + (if (nil? (get l t)) + (conj l {t 1}) + (conj l {t (inc (get l t))})))) {} jobs))) (defn sum-queue "Count all job aggregated by type" @@ -154,4 +151,4 @@ (let [jid (-> (request-job id) :job/id)] (end-job a) (start-job id jid) - {:job_id jid :agent_id id})))) \ No newline at end of file + jid)))) \ No newline at end of file -- cgit v1.2.3