diff --git a/flow/cmd/validate_peer.go b/flow/cmd/validate_peer.go index 2a88132f7..44b675ed9 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,