Skip to content

Commit ccb2ff7

Browse files
VitalyVitaly
authored andcommitted
Mix format
1 parent 3d6ecfd commit ccb2ff7

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

services/app/apps/codebattle/lib/codebattle/tournament/season_tournament_generator.ex

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,6 @@ defmodule Codebattle.Tournament.SeasonTournamentGenerator do
7373

7474
# Rookie tournaments - once per 4 hours at specific times: 3 7 11 15 19 23 UTC
7575
defp add_rookie_tournaments(tournaments, {start_date, end_date}, season) do
76-
num =
77-
case hour do
78-
3 -> 0
79-
7 -> 1
80-
11 -> 2
81-
15 -> 3
82-
19 -> 4
83-
23 -> 5
84-
end
85-
8676
rookie_tournaments =
8777
start_date
8878
|> generate_daily_tournaments(end_date, fn date ->
@@ -94,7 +84,7 @@ defmodule Codebattle.Tournament.SeasonTournamentGenerator do
9484
%Tournament{},
9585
Map.merge(
9686
%{
97-
name: "Rookie S:#{season} #{num} #{format_date(date)}",
87+
name: "Rookie S:#{season} #{get_rookie_hour_num(hour)} #{format_date(date)}",
9888
description: "Rookie tournament - easy tasks, grind-friendly",
9989
grade: "rookie",
10090
starts_at: starts_at,
@@ -514,4 +504,15 @@ defmodule Codebattle.Tournament.SeasonTournamentGenerator do
514504
end
515505

516506
defp year_from_date_range(start_date, _end_date), do: start_date.year
507+
508+
defp get_rookie_hour_num(hour) do
509+
case hour do
510+
3 -> 0
511+
7 -> 1
512+
11 -> 2
513+
15 -> 3
514+
19 -> 4
515+
23 -> 5
516+
end
517+
end
517518
end

0 commit comments

Comments
 (0)