fix pattern match
All checks were successful
Build and Publish / build-release (push) Successful in 1m23s
All checks were successful
Build and Publish / build-release (push) Successful in 1m23s
This commit is contained in:
@@ -30,9 +30,12 @@ defmodule PolicyService.Consumers.QuoteTaskConsumer do
|
||||
|
||||
def handle_info({:basic_deliver, payload, %{delivery_tag: tag}}, %{channel: ch} = state) do
|
||||
with {:ok, event} <- Jason.decode(payload),
|
||||
{:ok, _} <- dispatch(event) do
|
||||
:ok <- dispatch(event) do
|
||||
AMQP.Basic.ack(ch, tag)
|
||||
else
|
||||
{:ok, _} ->
|
||||
AMQP.Basic.ack(ch, tag)
|
||||
|
||||
{:error, reason} ->
|
||||
Logger.error("QuoteTaskConsumer failed: #{inspect(reason)}")
|
||||
AMQP.Basic.nack(ch, tag, requeue: false)
|
||||
|
||||
Reference in New Issue
Block a user