add dialyzer and fix id
All checks were successful
Build and Publish / build-release (push) Successful in 1m28s

This commit is contained in:
2026-04-21 14:26:37 -05:00
parent 2bf99bfb37
commit ca86980833
9 changed files with 158 additions and 29 deletions

View File

@@ -17,8 +17,8 @@ defmodule WorkloadService.Consumers.QuoteRequestedConsumer do
{:ok, conn} = AMQP.Connection.open(amqp_url())
{:ok, channel} = AMQP.Channel.open(conn)
AMQP.Queue.declare(channel, @queue, durable: true)
AMQP.Queue.bind(channel, @queue, @exchange, routing_key: @routing_key)
:ok = AMQP.Queue.declare(channel, @queue, durable: true)
:ok = AMQP.Queue.bind(channel, @queue, @exchange, routing_key: @routing_key)
{:ok, _tag} = AMQP.Basic.consume(channel, @queue)
Logger.info("QuoteRequestedConsumer started, listening on #{@queue}")
@@ -31,14 +31,15 @@ defmodule WorkloadService.Consumers.QuoteRequestedConsumer do
def handle_info({:basic_cancel_ok, _}, state), do: {:noreply, state}
def handle_info({:basic_deliver, payload, meta}, state) do
case process(payload) do
:ok ->
AMQP.Basic.ack(state.channel, meta.delivery_tag)
:ok =
case process(payload) do
:ok ->
AMQP.Basic.ack(state.channel, meta.delivery_tag)
{:error, reason} ->
Logger.error("QuoteRequestedConsumer: failed to process: #{inspect(reason)}")
AMQP.Basic.reject(state.channel, meta.delivery_tag, requeue: false)
end
{:error, reason} ->
Logger.error("QuoteRequestedConsumer: failed to process: #{inspect(reason)}")
AMQP.Basic.reject(state.channel, meta.delivery_tag, requeue: false)
end
{:noreply, state}
end