mount

erwinrooijakkers 2019-05-07T09:10:12.017800Z

Hi all

erwinrooijakkers 2019-05-07T09:10:21.018100Z

Is mount/start asynchronous?

erwinrooijakkers 2019-05-07T09:10:58.018900Z

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

erwinrooijakkers 2019-05-07T09:12:20.020400Z

(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

erwinrooijakkers 2019-05-07T10:05:01.021300Z

Okay db in Luminus is loaded before

erwinrooijakkers 2019-05-07T10:05:12.021700Z

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

erwinrooijakkers 2019-05-07T10:20:38.022500Z

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

erwinrooijakkers 2019-05-07T10:21:16.023200Z

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