Don't pass args to Watcher

This commit is contained in:
Jeff Gandt
2017-12-13 09:43:08 -05:00
parent 3742caf1b4
commit 42f3c93640
2 changed files with 4 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ defmodule ElixirKoans do
worker(Display, []), worker(Display, []),
worker(Tracker, []), worker(Tracker, []),
worker(Runner, []), worker(Runner, []),
worker(Watcher, [[]]) worker(Watcher, [])
] ]
opts = [strategy: :one_for_one, name: ElixirKoans.Supervisor] opts = [strategy: :one_for_one, name: ElixirKoans.Supervisor]

View File

@@ -1,12 +1,12 @@
defmodule Watcher do defmodule Watcher do
use GenServer use GenServer
def start_link(args) do def start_link() do
GenServer.start_link(__MODULE__, args) GenServer.start_link(__MODULE__, [dirs: ["lib/koans"]])
end end
def init(args) do def init(args) do
{:ok, watcher_pid} = FileSystem.start_link(dirs: ["lib/koans"]) {:ok, watcher_pid} = FileSystem.start_link(args)
FileSystem.subscribe(watcher_pid) FileSystem.subscribe(watcher_pid)
{:ok, %{watcher_pid: watcher_pid}} {:ok, %{watcher_pid: watcher_pid}}
end end