Skip to content

Commit

Permalink
Avoid logging normal exits (#140)
Browse files Browse the repository at this point in the history
* chore: silently handle a :normal exit message

* chore: bump version to 6.0.2
  • Loading branch information
claudio-dalicandro authored Mar 24, 2023
1 parent ffc601c commit fc9d713
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Written to prevent duplicated and boilerplate code to handle all the lifecycle o
```elixir
def deps do
[
{:amqpx, "~> 6.0.1"}
{:amqpx, "~> 6.0.2"}
]
end
```
Expand Down
2 changes: 2 additions & 0 deletions lib/amqp/gen/consumer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ defmodule Amqpx.Gen.Consumer do
{:stop, :channel_exited, state}
end

def handle_info({:EXIT, _, :normal}, state), do: {:noreply, state}

def handle_info(message, state) do
Logger.warn("Unknown message received #{inspect(message)}")
{:noreply, state}
Expand Down
2 changes: 2 additions & 0 deletions lib/amqp/gen/producer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ defmodule Amqpx.Gen.Producer do
{:stop, :channel_exited, state}
end

def handle_info({:EXIT, _, :normal}, state), do: {:noreply, state}

def handle_info(message, state) do
Logger.warn("Unknown message received #{inspect(message)}")
{:noreply, state}
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule Amqpx.MixProject do
[
app: :amqpx,
name: "amqpx",
version: "6.0.1",
version: "6.0.2",
elixir: "~> 1.7",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :production,
Expand Down

0 comments on commit fc9d713

Please sign in to comment.