diff options
author | Simponic <loganhunt@simponic.xyz> | 2023-01-20 23:48:34 -0700 |
---|---|---|
committer | Simponic <loganhunt@simponic.xyz> | 2023-01-20 23:48:34 -0700 |
commit | 804d47d81db5c2bda4465dab28276bf2cab226d1 (patch) | |
tree | fec6f462c9477b941f5dbe54ef20a669b1e4d755 /lib/chessh | |
parent | 5dbe76f6c2f702dad664cce6097c189ceea181b1 (diff) | |
download | chessh-804d47d81db5c2bda4465dab28276bf2cab226d1.tar.gz chessh-804d47d81db5c2bda4465dab28276bf2cab226d1.zip |
Fix test by reverting expired session closing logic
Diffstat (limited to 'lib/chessh')
-rw-r--r-- | lib/chessh/schema/player_session.ex | 5 |
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 |