Skip to content

Commit

Permalink
validate: 1 minute timeout (#2183)
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex authored Oct 24, 2024
1 parent 5c3df7b commit 2c9fb2e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions flow/cmd/validate_peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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,
Expand Down

0 comments on commit 2c9fb2e

Please sign in to comment.