Skip to content

Commit 614073e

Browse files
committed
Added optional argument for the start_link/0 function
1 parent 5a0ad6a commit 614073e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/worker.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ defmodule Spotter.Worker do
2727
end
2828

2929
def start_link() do
30-
GenServer.start_link(__MODULE__, %{config: config()})
30+
GenServer.start_link(__MODULE__, %{config: config(), opts: []})
3131
end
3232

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

4646
channel = get_channel()
47-
{:ok, [channel: channel, meta: configure(channel, opts[:opts])]}
47+
{:ok, custom} = configure(channel, opts[:opts])
48+
{:ok, [channel: channel, meta: custom]}
4849
end
4950
end
5051

0 commit comments

Comments
 (0)