Skip to content

Commit

Permalink
Running -main now causes jetty to block, fixing a bug where lein woul…
Browse files Browse the repository at this point in the history
…d prematurely call shutdown-agents for cleanup.
  • Loading branch information
amcnamara committed Aug 31, 2011
1 parent 715f849 commit b6d6cca
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/foreclojure/core.clj
Expand Up @@ -11,6 +11,8 @@
(:require [compojure [route :as route] [handler :as handler]]
[sandbar.stateful-session :as session]))

(def *block-server* false)

(defroutes main-routes
(GET "/" [] (welcome-page))
login-routes
Expand Down Expand Up @@ -39,7 +41,8 @@

(defn run []
(prepare-mongo)
(run-jetty (var app) {:join? false :port 8080}))
(run-jetty (var app) {:join? *block-server* :port 8080}))

(defn -main [& args]
(run))
(binding [*block-server* true]
(run)))

0 comments on commit b6d6cca

Please sign in to comment.