♻️ Refactor exporter state initialization.

This commit is contained in:
Andrey Antukh 2021-05-05 09:28:12 +02:00 committed by Andrés Moya
parent 4825efb582
commit abb244c940
12 changed files with 308 additions and 287 deletions

View file

@ -21,10 +21,9 @@
(defn start
[& args]
(log/info :msg "initializing")
(p/let [browser (bwr/start!)
server (http/start! {:browser browser})]
(reset! state {:http server
:browser browser})))
(p/do!
(bwr/init)
(http/init)))
(def main start)
@ -35,8 +34,6 @@
(log/info :msg "stoping")
(p/do!
(when-let [instance (:browser @state)]
(bwr/stop! instance))
(when-let [instance (:http @state)]
(http/stop! instance))
(bwr/stop)
(http/stop)
(done)))