Skip to content

Commit 01d8df0

Browse files
author
dovixman
committed
add 5 second timeout to initialState call instead of using the turn timeout
1 parent e133f9b commit 01d8df0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/engine/game/initialstate.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7+
"time"
78

89
"github.com/jonasdacruz/lighthouses_aicontest/internal/engine/lighthouse"
910
"github.com/jonasdacruz/lighthouses_aicontest/internal/engine/player"
@@ -57,7 +58,8 @@ func (e *Game) SendInitialState() {
5758
panic(err)
5859
}
5960

60-
ctx, cancel := context.WithTimeout(context.Background(), viper.GetDuration("turn_request_timeout"))
61+
// Add 5 seconds timeout to the InitialState call
62+
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
6163
defer cancel()
6264

6365
// sending initial state to player

0 commit comments

Comments
 (0)