Pin variable in match

This prevents accepting messages accidentally for another dying process.
This commit is contained in:
Jay Hayes
2016-04-26 17:43:11 -05:00
parent 6ae1cae4b8
commit 9b65177e17

View File

@@ -19,7 +19,7 @@ defmodule Mix.Tasks.Meditate do
if Tracker.complete?, do: Display.congratulate
receive do
{:DOWN, _references, :process, watcher, _reason} -> nil
{:DOWN, _references, :process, ^watcher, _reason} -> nil
end
end