diff --git a/apps/scrapper/lib/scrapper/queue/match_queue.ex b/apps/scrapper/lib/scrapper/queue/match_queue.ex index c5912d6..13e284a 100644 --- a/apps/scrapper/lib/scrapper/queue/match_queue.ex +++ b/apps/scrapper/lib/scrapper/queue/match_queue.ex @@ -6,10 +6,11 @@ defmodule Scrapper.Queue.MatchQueue do GenServer.start_link(__MODULE__, {}, name: __MODULE__) end - @spec init({}) :: {:ok, {AMQP.Channel.t(), AMQP.Connection.t()}} + @spec init({}) :: {:ok, %{channel: AMQP.Channel.t(), connection: AMQP.Connection.t()}} def init({}) do {:ok, connection} = AMQP.Connection.open() {:ok, channel} = AMQP.Channel.open(connection) + AMQP.Queue.declare(channel, "match", durable: true) {:ok, %{:channel => channel, :connection => connection}} end diff --git a/apps/scrapper/lib/scrapper/queue/player_queue.ex b/apps/scrapper/lib/scrapper/queue/player_queue.ex index 948aaf7..bbc998d 100644 --- a/apps/scrapper/lib/scrapper/queue/player_queue.ex +++ b/apps/scrapper/lib/scrapper/queue/player_queue.ex @@ -9,6 +9,7 @@ defmodule Scrapper.Queue.PlayerQueue do def init(_opts) do {:ok, connection} = AMQP.Connection.open() {:ok, channel} = AMQP.Channel.open(connection) + AMQP.Queue.declare(channel, "player", durable: true) {:ok, {channel, connection}} end @@ -18,7 +19,6 @@ defmodule Scrapper.Queue.PlayerQueue do nil -> GenServer.call(__MODULE__, {:queue_player, puuid}) _ -> :already_processed end - end def handle_call({:queue_player, puuid}, _from, {channel, _} = state) do