This commit is contained in:
Michiel Borkent 2020-01-17 17:26:03 +01:00
parent 8d0c03c8f6
commit d9a75cf8cf
2 changed files with 13 additions and 3 deletions

View file

@ -419,8 +419,17 @@ Everything after that is bound to *command-line-args*."))
(defn -main (defn -main
[& args] [& args]
(if-let [dev-opts (System/getenv "BABASHKA_DEV")]
(let [{:keys [:n]} (edn/read-string dev-opts)
last-iteration (dec n)]
(dotimes [i n]
(if (< i last-iteration)
(with-out-str (apply main args))
(do (apply main args)
(binding [*out* *err*]
(println "ran" n "times"))))))
(let [exit-code (apply main args)] (let [exit-code (apply main args)]
(System/exit exit-code))) (System/exit exit-code))))
;;;; Scratch ;;;; Scratch

View file

@ -8,5 +8,6 @@
(require '[clj-async-profiler.core :as prof]) (require '[clj-async-profiler.core :as prof])
(defn -main [& options] (defn -main [& options]
(prof/profile (apply main/main options)) (prof/profile (dotimes [_ 100]
(apply main/main options)))
(shutdown-agents)) (shutdown-agents))