Should fix repl once more

This commit is contained in:
2024-02-08 20:36:04 -08:00
parent 959c4ed74f
commit 487a171693
4 changed files with 16 additions and 56 deletions

View File

@@ -1,5 +1,6 @@
(ns user
(:require [amazonica.aws.s3 :as s3]
[auto-ap.server]
[auto-ap.datomic :refer [conn pull-attr random-tempid]]
[auto-ap.solr :as solr]
[auto-ap.time :as atime]
@@ -357,47 +358,14 @@
:handler auto-reset-handler}]))
(defn gzip-handler []
(doto (GzipHandler.)
(.setIncludedMimeTypes (into-array ["text/css"
"text/plain"
"text/javascript"
"text/csv"
"text/html"
"text/html;charset=utf-8"
"application/javascript"
"application/csv"
"application/edn"
"application/json"
"image/svg+xml"]))
(.setMinGzipSize 1024)))
(defn configure-jetty [server]
(let [ gzip-handler (gzip-handler)
default-handler (.getHandler server)]
(.setHandler gzip-handler default-handler)
(.setHandler server gzip-handler))
(.setStopAtShutdown server true))
(mount/defstate port :start (Integer/parseInt (or (env :port) "3000")))
(mount/defstate jetty
:start (run-jetty app {:port port
:join? false
:configurator configure-jetty
:response-header-size 16384
:request-header-size 16384})
:stop (.stop jetty))
(defn start-http []
(mount.core/start (mount.core/only #{#'user/port #'user/jetty})))
(mount.core/start (mount.core/only #{#'auto-ap.server/port #'auto-ap.server/jetty})))
(defn start-dev []
(set-refresh-dirs "src")
#_(clojure.tools.namespace.repl/disable-reload! (find-ns 'auto-ap.server))
(clojure.tools.namespace.repl/disable-reload! (find-ns 'auto-ap.time))
#_(clojure.tools.namespace.repl/disable-reload! (find-ns 'auto-ap.time))
(start-db)
(start-http)
(auto-reset))