From 3311eb41d0869ac46728f9d5c125f85dc3d7ea27 Mon Sep 17 00:00:00 2001 From: Damian Zaremba Date: Tue, 10 Dec 2024 19:36:31 +0000 Subject: [PATCH] core - tweak timeouts --- pkg/cbng/processor/core.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/cbng/processor/core.go b/pkg/cbng/processor/core.go index 30c5277..9c6474e 100644 --- a/pkg/cbng/processor/core.go +++ b/pkg/cbng/processor/core.go @@ -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()) @@ -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