Skip to content

Commit

Permalink
switch to Tackle.Connection.open
Browse files Browse the repository at this point in the history
  • Loading branch information
radwo committed Nov 23, 2023
1 parent 5f129c6 commit fa367d6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/tackle.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule Tackle do
|> Tackle.Util.parse_exchange()

Logger.debug("Connecting to '#{Tackle.Util.scrub_url(url)}'")
{:ok, connection} = AMQP.Connection.open(url)
{:ok, connection} = Tackle.Connection.open(url)
channel = Tackle.Channel.create(connection)

try do
Expand Down
4 changes: 2 additions & 2 deletions lib/tackle/connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ defmodule Tackle.Connection do
open_(name, url)
end

def open(url), do: AMQP.Connection.open(url)

@doc """
Get a list of opened connections
"""
Expand Down Expand Up @@ -101,6 +103,4 @@ defmodule Tackle.Connection do
defp validate_connection_process_rh(_alive? = false, _connection, _name) do
{:error, :no_process}
end

def open(url), do: AMQP.Connection.open(url)
end
2 changes: 1 addition & 1 deletion lib/tackle/delayed_retry.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule Tackle.DelayedRetry do
def publish(url, queue, payload, options) do
Logger.debug("Connecting to '#{Tackle.Util.scrub_url(url)}'")

{:ok, connection} = AMQP.Connection.open(url)
{:ok, connection} = Tackle.Connection.open(url)
{:ok, channel} = Channel.open(connection)

try do
Expand Down
2 changes: 1 addition & 1 deletion lib/tackle/republisher.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule Tackle.Republisher do
def republish(url, queue, exchange, routing_key, count) do
Logger.debug("Connecting to '#{Tackle.Util.scrub_url(url)}'")

{:ok, connection} = AMQP.Connection.open(url)
{:ok, connection} = Tackle.Connection.open(url)
channel = Tackle.Channel.create(connection)

try do
Expand Down

0 comments on commit fa367d6

Please sign in to comment.