Skip to content

Commit 3b3280d

Browse files
committed
Mf
1 parent b102fbc commit 3b3280d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

services/app/apps/codebattle/lib/codebattle/users_points_and_rank_update_server.ex

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@ defmodule Codebattle.UsersPointsAndRankUpdateServer do
5454

5555
# Recalculate user points when a non-open tournament finishes
5656
# Open tournaments are excluded from point recalculation as they don't affect user ratings
57-
def handle_info(%{event: "tournament:finished", payload: %{grade: grade}}, state)
58-
when grade != "open" do
59-
:timer.sleep(:timer.seconds(0.5))
57+
def handle_info(%{event: "tournament:finished", payload: %{grade: grade}}, state) when grade != "open" do
58+
:timer.sleep(to_timeout(second: 0.5))
6059
do_work()
6160
{:noreply, state}
6261
end

services/app/apps/codebattle/test/codebattle/tournament/entire/swiss_grand_slam_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ defmodule Codebattle.Tournament.Entire.SwissGrandSlamTest do
410410
}
411411
] = TournamentUserResult |> Repo.all() |> Enum.sort_by(& &1.user_id)
412412

413-
:timer.sleep(:timer.seconds(2))
413+
:timer.sleep(to_timeout(second: 2))
414414
assert %{rating: 1023, rank: 1, points: 2048} = Repo.get(User, u1_id)
415415
assert %{rating: 977, rank: 2, points: 1024} = Repo.get(User, u2_id)
416416
end

0 commit comments

Comments
 (0)