diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2018-02-21 13:05:43 -0300 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2018-02-21 13:05:43 -0300 |
commit | 540f46fece32d683411143152272c7564fd9ce45 (patch) | |
tree | 5846ac2cf3fa9ee4e201bd34698797a1a211ee8b /src/clj/queue_api/db/core.clj | |
parent | c16068d87243159830b48a6e17034573f2539524 (diff) | |
download | queue-api-540f46fece32d683411143152272c7564fd9ce45.tar.gz queue-api-540f46fece32d683411143152272c7564fd9ce45.tar.bz2 queue-api-540f46fece32d683411143152272c7564fd9ce45.zip |
Readme and doc
Diffstat (limited to 'src/clj/queue_api/db/core.clj')
-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) |