aboutsummaryrefslogtreecommitdiff
path: root/src/clj/queue_api/db/core.clj
diff options
context:
space:
mode:
Diffstat (limited to 'src/clj/queue_api/db/core.clj')
-rw-r--r--src/clj/queue_api/db/core.clj9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/clj/queue_api/db/core.clj b/src/clj/queue_api/db/core.clj
index adbda25..0ad9b81 100644
--- a/src/clj/queue_api/db/core.clj
+++ b/src/clj/queue_api/db/core.clj
@@ -156,7 +156,8 @@
[^String id]
(let [a (d/entity @conn [:agent/id id])]
(if-not (nil? a)
- (let [jid (:job/id (fittest-job id))]
- (end-job a)
- (start-job id jid)
- jid)))) \ No newline at end of file
+ (locking (Object.)
+ (let [jid (:job/id (fittest-job id))]
+ (end-job a)
+ (start-job id jid)
+ jid))))) \ No newline at end of file