Browse files

Merge branch 'release/1.8.0.1'

  • Loading branch information...
2 parents 8b6259c + 36b1de0 commit abe9d7155436865d05bf2f4f964eefef5380fcc1 @amalloy amalloy committed Dec 31, 2011
Showing with 14 additions and 3 deletions.
  1. +1 −1 project.clj
  2. +13 −2 src/foreclojure/core.clj
View
2 project.clj
@@ -1,4 +1,4 @@
-(defproject foreclojure "1.8.0"
+(defproject foreclojure "1.8.0.1"
:description "4clojure - a website for learning Clojure"
:dependencies [[clojure "1.2.1"]
[clojure-contrib "1.2.0"]
View
15 src/foreclojure/core.clj
@@ -3,6 +3,7 @@
[compojure.handler :as handler]
[foreclojure.config :as config]
[sandbar.stateful-session :as session])
+ (:import [java.lang OutOfMemoryError])
(:use [compojure.core :only [defroutes routes GET]]
[foreclojure.static :only [static-routes welcome-page]]
[foreclojure.api :only [api-routes]]
@@ -99,8 +100,18 @@
(defn run []
(prepare-mongo)
(register-heartbeat)
- (run-jetty (var app) {:join? *block-server*
- :port (get config :jetty-port default-jetty-port)})))
+ (letfn [(run []
+ (run-jetty (var app) {:join? *block-server*
+ :port (get config :jetty-port
+ default-jetty-port)}))]
+ (if *block-server*
+ (while true
+ (try
+ (run)
+ (catch OutOfMemoryError _
+ (binding [*out* *err*]
+ (println "Caught error at " (java.util.Date.))))))
+ (run)))))
(defn -main [& args]
(binding [*block-server* true]

0 comments on commit abe9d71

Please sign in to comment.