Skip to content

Commit

Permalink
(#621) config random timeout and bot speed calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
ReDBrother committed Feb 27, 2020
1 parent 814bd46 commit c66726a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion services/app/lib/codebattle/bot/playbook_player_runner.ex
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ defmodule Codebattle.Bot.PlaybookPlayerRunner do
end

defp activate_random_long_sleep(_) do
if :rand.uniform(16) > 14 do
if :rand.uniform(100) > 98 do
minutes = Kernel.round(@max_minutes_timeout * :rand.uniform())
:timer.sleep(minutes * 60 * 1_000)
end
Expand Down
4 changes: 2 additions & 2 deletions services/app/lib/codebattle/game_process/engine/bot.ex
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ defmodule Codebattle.GameProcess.Engine.Bot do
game_level = FsmHelpers.get_level(fsm)

low_level_time = %{
"elementary" => 60 * 3,
"easy" => 60 * 5,
"elementary" => 60 * 5,
"easy" => 60 * 6,
"medium" => 60 * 7,
"hard" => 60 * 9
}
Expand Down

0 comments on commit c66726a

Please sign in to comment.