summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/chessh/schema/player_session.ex5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/chessh/schema/player_session.ex b/lib/chessh/schema/player_session.ex
index cb06715..9543b92 100644
--- a/lib/chessh/schema/player_session.ex
+++ b/lib/chessh/schema/player_session.ex
@@ -86,7 +86,10 @@ defmodule Chessh.PlayerSession do
"Player #{player.username} has #{length(expired_sessions)} expired sessions - attempting to close them"
)
- Enum.map(expired_sessions, &close_session/1)
+ Enum.map(expired_sessions, fn session_id ->
+ :syn.publish(:player_sessions, {:session, session_id}, :session_closed)
+ end)
+
Repo.delete_all(from(p in PlayerSession, where: p.id in ^expired_sessions))
end