mount 2019-05-07

@erwinrooijakkers has joined the channel

Hi all

Is mount/start asynchronous?

I have an error in mount/starting one component and I try start the Sentry component first, but no errors are logged to it…

(defn -main [& args]
  (mount/start #'app.config/env)
  (mount/start #'app.core/sentry)
      (log/error "This error prints! But not to Sentry, while it should be initialized above")
      (System/exit 1)
  (.addShutdownHook (Runtime/getRuntime) (Thread. stop-app)))
So logging works and we see the log/error, but Sentry is not initialized still somehow

Okay db in Luminus is loaded before

So makes sense, only don’t know why it is required first

It was because I included a dynamic variable in a require with :refer [*db*], it works when I use :alias db and then db/*db* in the code

Mount takes the order of the compiler and the Clojure compiler probably gets explicit refers always, and refers via an alias in another way