From 804d47d81db5c2bda4465dab28276bf2cab226d1 Mon Sep 17 00:00:00 2001 From: Simponic Date: Fri, 20 Jan 2023 23:48:34 -0700 Subject: [PATCH] Fix test by reverting expired session closing logic --- lib/chessh/schema/player_session.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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