bgoosman

bgoosman

Question about Oban jobs, retrying, and recompiling

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:

  1. Send HTTP request to my Phoenix server to enqueue A.
  2. Wait for a failure. Make a fix.
  3. 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.

Please restore my sanity :).

Marked As Solved

garrison

garrison

There is a Code Reloader and a Live Reloader.

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.

Also Liked

lud

lud

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?

bgoosman

bgoosman

Thank you @lud, @garrison for the insightful answers. Exactly what I was looking for, since I had no idea Code Reloader and Live Reloader existed.

Where Next?

Popular in Questions Top

Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
pgiesin
This should be a simple problem but I just can’t seem to figure it out. I have a standalone Elixir app that won’t find the database. Dep...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
gonzofish
I’m currently trying to understand how to join three tables using Ecto. All the examples I’ve seen use 2, so maybe I’m just missing somet...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
AstonJ
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New

We're in Beta

About us Mission Statement