Tasks: fix edge case
This commit is contained in:
parent
35874fa5ce
commit
82625b57dd
1 changed files with 11 additions and 11 deletions
|
|
@ -158,17 +158,17 @@
|
||||||
(format "
|
(format "
|
||||||
(let [chans (filter babashka.tasks/-chan? %s)]
|
(let [chans (filter babashka.tasks/-chan? %s)]
|
||||||
(loop [cs chans]
|
(loop [cs chans]
|
||||||
(let [[v p] (clojure.core.async/alts!! cs)
|
(when (seq cs)
|
||||||
[task-name v] v
|
(let [[v p] (clojure.core.async/alts!! cs)
|
||||||
cs (filterv #(not= p %%) cs)
|
[task-name v] v
|
||||||
;; _ (.println System/err (str \"n: \" task-name \" v: \" v))
|
cs (filterv #(not= p %%) cs)
|
||||||
;; check for existence of v, as the channel may already have been consumed once
|
;; _ (.println System/err (str \"n: \" task-name \" v: \" v))
|
||||||
_ (when v (intern *ns* (symbol task-name) v))]
|
;; check for existence of v, as the channel may already have been consumed once
|
||||||
(when (instance? Throwable v)
|
_ (when v (intern *ns* (symbol task-name) v))]
|
||||||
(throw (ex-info (ex-message v)
|
(when (instance? Throwable v)
|
||||||
{:babashka/exit 1
|
(throw (ex-info (ex-message v)
|
||||||
:data (ex-data v)})))
|
{:babashka/exit 1
|
||||||
(when (seq cs)
|
:data (ex-data v)})))
|
||||||
(recur cs)))))" deps)
|
(recur cs)))))" deps)
|
||||||
"")
|
"")
|
||||||
#_(format "(def %s (babashka.tasks/-wait %s))" dep dep))
|
#_(format "(def %s (babashka.tasks/-wait %s))" dep dep))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue