Skip to content

Commit

Permalink
core - tweak timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianZaremba committed Dec 10, 2024
1 parent 06b5b29 commit 3311eb4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/cbng/processor/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func isVandalism(l *logrus.Entry, parentCtx context.Context, configuration *conf
coreUrl := fmt.Sprintf("%s:%d", coreHost, configuration.Core.Port)
logger.Tracef("Connecting to %v", coreUrl)

dialer := net.Dialer{Timeout: time.Second * 10}
dialer := net.Dialer{Timeout: time.Second * 5}
conn, err := dialer.Dial("tcp", coreUrl)
if err != nil {
scoreSpan.SetStatus(codes.Error, err.Error())
Expand All @@ -109,12 +109,12 @@ func isVandalism(l *logrus.Entry, parentCtx context.Context, configuration *conf
}
defer conn.Close()

if err := conn.SetDeadline(time.Now().Add(time.Second * 2)); err != nil {
if err := conn.SetDeadline(time.Now().Add(time.Second * 10)); err != nil {
scoreSpan.SetStatus(codes.Error, err.Error())
logger.Errorf("Could not set deadline: %v", err)
return false, err
}
if err := conn.SetReadDeadline(time.Now().Add(time.Second * 2)); err != nil {
if err := conn.SetReadDeadline(time.Now().Add(time.Second * 10)); err != nil {
scoreSpan.SetStatus(codes.Error, err.Error())
logger.Errorf("Could not set read deadline: %v", err)
return false, err
Expand Down

0 comments on commit 3311eb4

Please sign in to comment.