mirror of
https://github.com/ash-project/reactor.git
synced 2024-09-19 12:53:19 +12:00
fix: initialisation issue with middlewares.
So yeah, apparently `function_exported?/3` doesn't ensure that the module in question is actually loaded.
This commit is contained in:
parent
574f64d50a
commit
220227d459
1 changed files with 4 additions and 1 deletions
|
@ -17,7 +17,10 @@ defmodule Reactor.Executor.Hooks do
|
|||
initial_state: reactor.state
|
||||
})
|
||||
|
||||
Utils.reduce_while_ok(reactor.middleware, context, fn middleware, context ->
|
||||
reactor.middleware
|
||||
|> Utils.reduce_while_ok(context, fn middleware, context ->
|
||||
Code.ensure_loaded!(middleware)
|
||||
|
||||
if function_exported?(middleware, :init, 1) do
|
||||
middleware.init(context)
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue