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