-
-
Notifications
You must be signed in to change notification settings - Fork 312
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
Shared hook compilation failure #876
Comments
I don't believe an Oban module should use I'm curious, is |
One other thing—is this happening in dev with code reloading, or from running a standalone |
@sorentwo the module name is a standard-looking name like
It happens in both scenarios and sometimes randomly on GitHub CI which runs:
Another weird fix that I forgot to mention on dev with code reloading is if I remove the |
Ok. On CI it would still have progressive compilation. I believe what's happening is that when the old version of the module initializes. I'm investigating and trying to recreate the problem still. |
The issue was that there wasn't a compilation dependency between the hooks and the worker, but the worker tried verifying hook modules during compilation. It's fixed for the next release. |
Environment
elixir --version
): Elixir 1.14.2 (compiled with Erlang/OTP 25)Current Behavior
Hello, I'm using a shared hook for Oban Pro worker (https://getoban.pro/docs/pro/0.13.0/Oban.Pro.Worker.html#module-worker-hooks) and attached it to two different worker modules, which works fine until I edit the shared hook module - the compilation fails with:
MyApp.shared_hook
is a module that implementsafter_process/2
. And insidemy_worker.ex
I'm using the shared hook:Digging through Oban code, I found the following snippet when initializing the hooks in
Oban.Pro.Stages.Hooks
.validate_opt/1
:Code.ensure_loaded?
is returning false whenever a change happens to that file, recompiling fixes the issue. I adjusted the above code to also ensure that the modules passed are complied, which seems to be fixing the issue:I'm not sure if the above fix is needed, or if I'm using the shared hooks incorrectly.
Expected Behavior
Using a shared hook shouldn't result in a compilation failure when editing the shared hook file.
The text was updated successfully, but these errors were encountered: