Skip to content
Browse files

Running -main now causes jetty to block, fixing a bug where lein woul…

…d prematurely call shutdown-agents for cleanup.
  • Loading branch information...
1 parent 715f849 commit b6d6cca96a846c9b330d70798f1a02290072a04c @amcnamara amcnamara committed Aug 31, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/foreclojure/core.clj
View
7 src/foreclojure/core.clj
@@ -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
@@ -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.
Something went wrong with that request. Please try again.