From 2c9fb2eb39ba077a1da27116463632530f595f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Thu, 24 Oct 2024 15:14:23 +0000 Subject: [PATCH] validate: 1 minute timeout (#2183) #2182 --- flow/cmd/validate_peer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flow/cmd/validate_peer.go b/flow/cmd/validate_peer.go index 2a88132f73..44b675ed90 100644 --- a/flow/cmd/validate_peer.go +++ b/flow/cmd/validate_peer.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "log/slog" + "time" "github.com/PeerDB-io/peer-flow/connectors" connpostgres "github.com/PeerDB-io/peer-flow/connectors/postgres" @@ -16,6 +17,8 @@ func (h *FlowRequestHandler) ValidatePeer( ctx context.Context, req *protos.ValidatePeerRequest, ) (*protos.ValidatePeerResponse, error) { + ctx, cancelCtx := context.WithTimeout(ctx, time.Minute) + defer cancelCtx() if req.Peer == nil { return &protos.ValidatePeerResponse{ Status: protos.ValidatePeerStatus_INVALID,