diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/clj/queue_api/db/core.clj | 8 |
1 files changed, 4 insertions, 4 deletions
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) |