fix with-process and delete-process!

This commit is contained in:
Valentin Boettcher 2020-07-31 19:09:54 +02:00
parent ac893df07e
commit 86089dcc18

View file

@ -2,7 +2,6 @@
(:require [stream.commander.systemd :as sys] (:require [stream.commander.systemd :as sys]
[stream.commander.journal :as journal] [stream.commander.journal :as journal]
[clojure.string :as string] [clojure.string :as string]
[clojure.core.match :refer [match]]
[taoensso.timbre :as timbre [taoensso.timbre :as timbre
:refer [log trace debug info warn error fatal report :refer [log trace debug info warn error fatal report
logf tracef debugf infof warnf errorf fatalf reportf logf tracef debugf infof warnf errorf fatalf reportf
@ -238,12 +237,12 @@
[proc proc-var & body] [proc proc-var & body]
`(if-let [~proc-var `(if-let [~proc-var
(cond (cond
(string? proc) (string? ~proc)
(get-process! ~proc) (get-process! ~proc)
(instance? process proc) (instance? process ~proc)
proc ~proc
:default proc)] :default ~proc)]
(do ~@body) (do ~@body)
false)) false))
@ -258,7 +257,7 @@
(close! (:supervisor proc)) (close! (:supervisor proc))
(sys/remove-service! unit-name) (sys/remove-service! unit-name)
(close) (close)
(dosync (commute processes dissoc (:id process))) (dosync (commute processes dissoc (:id proc)))
true))) true)))
(defn delete-all-processes! [] (defn delete-all-processes! []