Skip to content

Commit 06d2907

Browse files
committed
Don't block on destroy sessions
1 parent af21f0f commit 06d2907

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/hound/session_server.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,12 @@ defmodule Hound.SessionServer do
110110
sessions = all_sessions_for_pid(pid)
111111
:ets.delete(@name, pid)
112112
Enum.each sessions, fn({_session_name, session_id})->
113-
Hound.Session.destroy_session(session_id)
113+
spawn fn -> destroy_session(session_id) end
114114
end
115115
end
116+
117+
defp destroy_session(session_id) do
118+
Hound.Session.destroy_session(session_id)
119+
rescue Hound.Error -> false
120+
end
116121
end

0 commit comments

Comments
 (0)