Skip to content

Commit

Permalink
Reduced cyclic compilation dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
vloothuis committed Oct 13, 2023
1 parent 5cd2015 commit 7846f63
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
29 changes: 15 additions & 14 deletions core/frameworks/signal/_public.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ defmodule Frameworks.Signal.Public do
import Frameworks.Utililty.PrettyPrint

@signal_handlers [
Core.Accounts.SignalHandlers,
Core.Mailer.SignalHandlers,
Core.WebPush.SignalHandlers,
Core.APNS.SignalHandlers,
Systems.Observatory.Switch,
Systems.Project.Switch,
Systems.Assignment.Switch,
Systems.Workflow.Switch,
Systems.Pool.Switch,
Systems.Student.Switch,
Systems.Campaign.Switch,
Systems.NextAction.Switch
"Core.Accounts.SignalHandlers",
"Core.Mailer.SignalHandlers",
"Core.WebPush.SignalHandlers",
"Core.APNS.SignalHandlers",
"Systems.Observatory.Switch",
"Systems.Project.Switch",
"Systems.Assignment.Switch",
"Systems.Workflow.Switch",
"Systems.Pool.Switch",
"Systems.Student.Switch",
"Systems.Campaign.Switch",
"Systems.NextAction.Switch"
]

def dispatch(signal, message) do
Expand Down Expand Up @@ -46,7 +46,8 @@ defmodule Frameworks.Signal.Public do
end

defp signal_handlers do
Application.get_env(:core, :signal_handlers, []) ++
@signal_handlers
(Application.get_env(:core, :signal_handlers, []) ++
@signal_handlers)
|> Enum.map(fn module_name -> String.to_atom("Elixir.#{module_name}") end)
end
end
2 changes: 1 addition & 1 deletion core/test/test_helper.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Application.put_env(:core, :web_push_backend, Core.WebPush.MockBackend)
Mox.defmock(Core.APNS.MockBackend, for: Core.APNS.Backend)
Application.put_env(:core, :apns_backend, Core.APNS.MockBackend)

Application.put_env(:core, :signal_handlers, [Frameworks.Signal.TestHelper])
Application.put_env(:core, :signal_handlers, ["Frameworks.Signal.TestHelper"])

Application.put_env(
:core,
Expand Down

0 comments on commit 7846f63

Please sign in to comment.