Skip to content

Commit

Permalink
Fix wrong usage of gproc:get_value/2
Browse files Browse the repository at this point in the history
  • Loading branch information
edgurgel committed Jul 26, 2013
1 parent fac5c67 commit f631207
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/poxa/presence_subscription.ex
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,13 @@ defmodule Poxa.PresenceSubscription do
end

defp only_one_connection_on_user_id?(channel, user_id) do
case :gproc.get_value({:c, :l, {:presence, channel, user_id}}, :shared) do
1 -> true
_ -> false
try do
case :gproc.get_value({:c, :l, {:presence, channel, user_id}}, :shared) do
1 -> true
_ -> false
end
rescue
ArgumentError -> false
end
end
end

0 comments on commit f631207

Please sign in to comment.