diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2012-06-25 21:23:55 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2012-06-25 21:23:55 +0200 |
commit | 22acc50a5aa38b20c13a5fa650c7988d4cb2a677 (patch) | |
tree | 8bbfd15818cf5e11e65186690880f3d1a8c3c960 /src | |
parent | c341089a912e14e134a70edea2539406f090c824 (diff) |
Load service namespaces lazily.
Diffstat (limited to 'src')
-rw-r--r-- | src/mulk/benki/main.clj | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mulk/benki/main.clj b/src/mulk/benki/main.clj index 354358a..bf15e1f 100644 --- a/src/mulk/benki/main.clj +++ b/src/mulk/benki/main.clj @@ -3,11 +3,11 @@ (:use [clojure core repl pprint] noir.core [hiccup core page] - [mulk.benki util config db]) + [mulk.benki config db util]) (:require [noir.core] [noir server options] - [mulk.benki wiki auth book_marx id lazychat xmpp genkey] [ring.middleware.file] + [ring.middleware.file-info] [noir.session :as session] [noir.request :as request] [clojure.java.jdbc :as sql] @@ -114,6 +114,7 @@ response)))) (do-once ::init + (noir.server/add-middleware #(ring.middleware.file-info/wrap-file-info %)) (noir.server/add-middleware #(hiccup.middleware/wrap-base-url % (:base-uri @benki-config))) (noir.server/add-middleware #(wrap-missing-status-code %)) (noir.server/add-middleware #(wrap-utf-8 %)) @@ -140,9 +141,12 @@ (defn -main [& args] (do + (noir.server/load-views-ns 'mulk.benki) (init-security!) - (future (mulk.benki.xmpp/init-xmpp!)) - (future (mulk.benki.lazychat/init-lazychat!)) + (future (require 'mulk.benki.xmpp) + ((ns-resolve 'mulk.benki.xmpp 'init-xmpp!))) + (future (require 'mulk.benki.lazychat) + ((ns-resolve 'mulk.benki.lazychat 'init-lazychat!))) (future (swap! server (run-server)))) (loop [] (Thread/sleep 1000000) |