From 540f46fece32d683411143152272c7564fd9ce45 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Wed, 21 Feb 2018 13:05:43 -0300 Subject: Readme and doc --- src/clj/queue_api/db/core.clj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/clj/queue_api/db/core.clj b/src/clj/queue_api/db/core.clj index 00af5cb..c76f0fb 100644 --- a/src/clj/queue_api/db/core.clj +++ b/src/clj/queue_api/db/core.clj @@ -17,7 +17,7 @@ (defn add-agent "Add an agent into the database" [{:keys [id name primary-skillset secondary-skillset]}] - (d/transact! queue-api.db.core/conn + (d/transact! conn [{:agent/id id :agent/name name :agent/primary-skillset primary-skillset @@ -26,7 +26,7 @@ (defn add-job "Add a job into the database" [{:keys [id type urgent]}] - (d/transact! queue-api.db.core/conn + (d/transact! conn [{:job/id id :job/type type :job/urgent urgent @@ -85,7 +85,7 @@ (conj l {t (inc (get l t))})))) {} jobs))) (defn sum-queue - "Count all jobs aggregated by type" + "List all jobs aggregated by status" [] {:completed (map first (q-status :completed)) :processing (map first (q-status :processing)) @@ -145,7 +145,7 @@ "Dequeue a job to a agent `id`" [^String id] (let [a (d/entity @conn [:agent/id id])] - (if (not (nil? a)) + (if-not (nil? a) (let [jid (:job/id (request-job id))] (end-job a) (start-job id jid) -- cgit v1.2.3