ring-clojure / ring

Clojure HTTP server abstraction
MIT License
3.75k stars 519 forks source link

wrap-reload not work on checkouts project #418

Closed paomian closed 3 years ago

paomian commented 3 years ago

i have two project A and B. A is dependent on B.and A path have soft links to B in checkouts/B/src when i modify A ,it work well.but when i modify B it does not work.

weavejester commented 3 years ago

You'll need to provide more information. How are you calling wrap-reload? What's the value of the :dirs option?

paomian commented 3 years ago
(defn wrap-dir-reload
  [app]
  (if (or (config/production?) (config/stage?))
    app
    (try
      ((eval '(do (use '[ring.middleware.reload])
                  wrap-reload))
       app
       {:dirs ["src" "checkouts/B/src"]})
      (catch Exception ex
        app))))

(def reload-app (-> some-other-middlewares wrap-dir-reload))

my reload middleware.

paomian commented 3 years ago

I'm sorry.this is my problem. because my handler will call self other path when start.wrap-reload middleware will reload my function.this time the handler is not ready.so it block here.