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:
parent
8057fb54a6
commit
f245656c0c
1 changed files with 15 additions and 7 deletions
|
@ -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))
|
||||||
|
|
Loading…
Add table
Reference in a new issue