Can I ask a dumb question? I’m working on an Oban.Job implemented by module A and noticing behavior I don’t understand with respect to when edits I make to it will cause recompilation.
My workflow is:
Send HTTP request to my Phoenix server to enqueue A.
Wait for a failure. Make a fix.
Re-run A, either by sending another HTTP request to enqueue A, or by pressing the Retry button in Oban dashboard.
It seems like when I press this Retry button in :4000/oban, my module doesn’t automatically recompile.
However when I send the HTTP request to enqueue A, then A’s module will recompile. I’ve tested this by adding simple dbg() statements, and notice they don’t log after pressing the Retry button.
I don’t know Oban Web but could it be that Oban Web uses liveview, and so when pressing the button your browser sends a message to a liveview process by an already open websocket connection, whereas when you call the api, the http request goes through the whole plug stack and the code reloader plug is called?
The code reloader recompiles the project when a new request hits the Phoenix server. The live reloader, on the other hand, listens to the filesystem and refreshes an open page when certain files are updated. The page refresh then triggers the code reloader and recompiles the project. There is a list of matches in your dev config which determines which files trigger live reload (by default, templates/liveviews/assets and so on).
In retrospect both of these “reloaders” have terrible names, the Code Reloader is actually a recompiler and the Live Reloader has nothing to do with LiveView.
Anyway, when you send a new request to the Phoenix server it then recompiles the project. But when you press a button on the dashboard (which is indeed LiveView afaik) it just runs the existing code. Note that if you were to update one of the modules which triggers the Live Reloader, it would refresh the page and therefore recompile the project. But you’re not doing that.
So yeah, essentially this. If you want to recompile the project you can just refresh the page in your browser before clicking the button.