0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-13 18:48:37 -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 (ns uxbox.main
(:require (:require
[mount.core :as mount] [mount.core :as mount]))
[uxbox.config :as cfg]
[uxbox.migrations] (defn- enable-asserts
[uxbox.db] [_]
[uxbox.http] (let [m (System/getProperty "uxbox.enable-asserts")]
#_[uxbox.scheduled-jobs]) (or (nil? m) (= "true" m))))
(:gen-class))
;; 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 ;; --- Entry point
(defn -main (defn -main
[& args] [& args]
(load "uxbox/config"
"uxbox/migrations"
"uxbox/http")
(mount/start)) (mount/start))