Skip to content

Commit

Permalink
Change supervisor strategy. Other improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpursley committed Jan 10, 2024
1 parent a073715 commit e2a2c0f
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/walex/config/registry.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ defmodule WalEx.Config.Registry do
defp set_name(module, app_name), do: {:via, Registry, {@walex_registry, {module, app_name}}}

def get_state(:get_agent, module, app_name) do
Agent.get({:via, Registry, {:walex_registry, {module, app_name}}}, & &1)
Agent.get({:via, Registry, {@walex_registry, {module, app_name}}}, & &1)
end
end
2 changes: 1 addition & 1 deletion lib/walex/decoder/decoder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ defmodule WalEx.Decoder do

defp decode_message_impl(<<"Y", data_type_id::integer-32, namespace_and_name::binary>>) do
[namespace, name_with_null] = :binary.split(namespace_and_name, <<0>>)
name = String.slice(name_with_null, 0..-2)
name = String.slice(name_with_null, 0..-2//1)

%Type{
id: data_type_id,
Expand Down
2 changes: 1 addition & 1 deletion lib/walex/destinations/supervisor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ defmodule WalEx.Destinations.Supervisor do
|> maybe_webhooks(app_name)
|> maybe_event_relay(app_name)

Supervisor.init(children, strategy: :one_for_all)
Supervisor.init(children, strategy: :one_for_one, max_restarts: 10)
end

defp maybe_event_modules(children, app_name) do
Expand Down
2 changes: 1 addition & 1 deletion lib/walex/replication/supervisor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ defmodule WalEx.Replication.Supervisor do
{Server, app_name: app_name}
]

Supervisor.init(children, strategy: :one_for_all)
Supervisor.init(children, strategy: :one_for_one, max_restarts: 10)
end
end
1 change: 0 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ defmodule WalEx.MixProject do
{:decimal, "~> 2.1.1"},
{:ex_doc, "~> 0.31.0", only: :dev, runtime: false},
{:jason, "~> 1.4"},
{:retry, "~> 0.18.0"},
{:timex, "~> 3.7"},
{:req, "~> 0.4.8"},
{:uniq, "~> 0.6.1"},
Expand Down

0 comments on commit e2a2c0f

Please sign in to comment.