0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-10 00:58:26 -05:00

Add a proper way to enable/disable assertions on clojure code.

This commit is contained in:
Andrey Antukh 2020-01-31 19:12:58 +01:00
parent 8057fb54a6
commit f245656c0c

View file

@ -9,16 +9,24 @@
(ns uxbox.main
(:require
[mount.core :as mount]
[uxbox.config :as cfg]
[uxbox.migrations]
[uxbox.db]
[uxbox.http]
#_[uxbox.scheduled-jobs])
(:gen-class))
[mount.core :as mount]))
(defn- enable-asserts
[_]
(let [m (System/getProperty "uxbox.enable-asserts")]
(or (nil? m) (= "true" m))))
;; Set value for current thread binding.
(set! *assert* (enable-asserts nil))
;; Set value for all new threads bindings.
(alter-var-root #'*assert* enable-asserts)
;; --- Entry point
(defn -main
[& args]
(load "uxbox/config"
"uxbox/migrations"
"uxbox/http")
(mount/start))