-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need to refresh twice to reload routes #444
Comments
Thanks for the report, I'll try take a look at this in the near future. |
I tried switching I tried the following locally: (defn app [] ...) and (mount/defstate ^{:on-reload :noop} http-server
:start
(http/start
(-> env
(assoc :handler (#'handler/app))
(update :io-threads #(or % (* 2 (.availableProcessors (Runtime/getRuntime)))))
(update :port #(or (-> env :options :port) %))))
:stop
(http/stop http-server)) |
Also, as a workaround it looks like calling |
Reproduction with the fix below. I think this is what the template generated before 8f177df, so this is just a simple rollback. There may be a better way to resolve this with while still using |
Ah perfect, looks like |
I see.. We can pass in the handler var instead of its value. Thanks! Routes probably change much more often than the base middleware, so this is a big improvement :) |
Yeah that's what I was thinking, and since there's a way to reload middleware from the REPL that seems like a decent compromise. :) |
The current template requires reloading page twice before any route change takes effect.
Steps to reproduce:
Expected:
New routing data works
Observed:
Old routing data is still in effect. When page is refreshed again, new routing data will take effect.
Analysis:
According to the logs, the first refresh did trigger namespace recompile, but somehow the old handler is still used to process the request. The second refresh does not trigger recompile, but the new handler is used.
I suspect this has something to do with commit 8f177df
I rolled back
handler/app
frommount/defstate
to plain old function and the issue is fixed. I am not sure if this has something to do withreitit
or not.Additional information:
I am using
immutant
as the http server. This should not make a difference though.The text was updated successfully, but these errors were encountered: