Skip to content

Commit

Permalink
Added optional argument for the start_link/0 function
Browse files Browse the repository at this point in the history
  • Loading branch information
Relrin committed Mar 26, 2018
1 parent 5a0ad6a commit 614073e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/worker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ defmodule Spotter.Worker do
end

def start_link() do
GenServer.start_link(__MODULE__, %{config: config()})
GenServer.start_link(__MODULE__, %{config: config(), opts: []})
end

def start_link(opts) do
Expand All @@ -44,7 +44,8 @@ defmodule Spotter.Worker do
@connection.configure_channel(@channel_name, opts[:config])

channel = get_channel()
{:ok, [channel: channel, meta: configure(channel, opts[:opts])]}
{:ok, custom} = configure(channel, opts[:opts])
{:ok, [channel: channel, meta: custom]}
end
end

Expand Down

0 comments on commit 614073e

Please sign in to comment.