From 8d965b9b015c2b370270f99f682553d3499195fe Mon Sep 17 00:00:00 2001 From: Tristan Date: Sun, 21 Jan 2024 14:31:31 -0500 Subject: [PATCH] Update lib/lanpartyseating/logic/tournaments_logic.ex Co-authored-by: Nicolas Berbiche --- lib/lanpartyseating/logic/tournaments_logic.ex | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/lanpartyseating/logic/tournaments_logic.ex b/lib/lanpartyseating/logic/tournaments_logic.ex index 7eeec95..960aab4 100644 --- a/lib/lanpartyseating/logic/tournaments_logic.ex +++ b/lib/lanpartyseating/logic/tournaments_logic.ex @@ -79,9 +79,10 @@ defmodule Lanpartyseating.TournamentsLogic do deleted_at: DateTime.truncate(DateTime.utc_now(), :second) ) - with {:ok, _updated} <- Repo.update(tournament) do - {:ok, stations} = StationLogic.get_all_stations() - {:ok, tournaments} = get_upcoming_tournaments() + with {:ok, _updated} <- Repo.update(tournament), + {:ok, stations} <- StationLogic.get_all_stations(), + {:ok, tournaments} <- get_upcoming_tournaments() + do GenServer.cast(:"expire_tournament_#{id}", :terminate) GenServer.cast(:"start_tournament_#{id}", :terminate) Phoenix.PubSub.broadcast(