Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fix up OOM-catch patch

  • Loading branch information...
commit dd0793e4549475c52f8562bc0a9af2e84dc809e5 1 parent f967795
@amalloy amalloy authored
Showing with 13 additions and 8 deletions.
  1. +13 −8 src/foreclojure/core.clj
21 src/foreclojure/core.clj
@@ -98,14 +98,19 @@
(let [default-jetty-port 8080]
(defn run []
- (try
- (do
- (prepare-mongo)
- (register-heartbeat)
- (run-jetty (var app) {:join? *block-server*
- :port (get config :jetty-port default-jetty-port)}))
- (catch OutOfMemoryError e
- ;;TODO: log this?
+ (prepare-mongo)
+ (register-heartbeat)
+ (letfn [(run []
+ (run-jetty (var app) {:join? *block-server*
+ :port (get config :jetty-port
+ default-jetty-port)}))]
+ (if *block-server*
@amcnamara Owner

This outer logic if/while is probably unnecessary, since if block-server is false run-jetty will fall through regardless and exit the try/catch and return from (run) as expected.

@amcnamara Owner

Scratch that, I think I see what you're doing now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ (while true
+ (try
+ (run)
+ (catch OutOfMemoryError _
+ (binding [*out* *err*]
+ (println "Caught error at " (java.util.Date.))))))
(defn -main [& args]

0 comments on commit dd0793e

Please sign in to comment.
Something went wrong with that request. Please try again.