aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvar Refsdal <ivar.refsdal@nsd.no>2021-09-27 09:39:54 +0200
committerIvar Refsdal <ivar.refsdal@nsd.no>2021-09-27 09:39:54 +0200
commitc62632771b11736eac616e00d576c349e54b6a73 (patch)
treece2713eee602a661f5450b168fcbf3c61d508cb6 /src
parentBetter error reporting (diff)
downloadfiinha-c62632771b11736eac616e00d576c349e54b6a73.tar.gz
fiinha-c62632771b11736eac616e00d576c349e54b6a73.tar.xz
Simplify
Diffstat (limited to 'src')
-rw-r--r--src/com/github/ivarref/yoltq/impl.clj12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/com/github/ivarref/yoltq/impl.clj b/src/com/github/ivarref/yoltq/impl.clj
index f97dcc4..02cc102 100644
--- a/src/com/github/ivarref/yoltq/impl.clj
+++ b/src/com/github/ivarref/yoltq/impl.clj
@@ -40,6 +40,10 @@
(if-let [q-config (get-in config [:handlers queue-name])]
(let [id (u/squuid)
depends-on (get q-config :depends-on (fn [_] nil))
+ opts (merge
+ (when-let [deps (depends-on payload)]
+ {:depends-on deps})
+ (or opts {}))
str-bindings (->> (reduce (fn [o k]
(assoc o (symbol k) (deref k)))
{}
@@ -52,15 +56,11 @@
:com.github.ivarref.yoltq/status u/status-init
:com.github.ivarref.yoltq/payload (pr-str-safe :payload payload)
:com.github.ivarref.yoltq/bindings str-bindings
- :com.github.ivarref.yoltq/opts (pr-str-safe :opts
- (merge
- (when-let [deps (depends-on payload)]
- {:depends-on deps})
- (or opts {})))
+ :com.github.ivarref.yoltq/opts (pr-str-safe :opts opts)
:com.github.ivarref.yoltq/lock (u/random-uuid)
:com.github.ivarref.yoltq/tries 0
:com.github.ivarref.yoltq/init-time (u/now-ns)}
- (when-let [[q ext-id] (or (:depends-on opts) (depends-on payload))]
+ (when-let [[q ext-id] (:depends-on opts)]
(when-not (d/q '[:find ?e .
:in $ ?ext-id
:where