Skip to content

Commit

Permalink
chore: bump timeout on FindNodesWithoutDeserializing
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanSpeakEasy authored and daveshanley committed Feb 14, 2024
1 parent 5ea4f2b commit 9d9ff8a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/vmware-labs/yaml-jsonpath/pkg/yamlpath"
"gopkg.in/yaml.v3"
"net/http"
"net/url"
"regexp"
"sort"
"strconv"
"strings"
"time"

"github.com/vmware-labs/yaml-jsonpath/pkg/yamlpath"
"gopkg.in/yaml.v3"
)

type Case int8
Expand Down Expand Up @@ -107,15 +108,14 @@ func FindNodesWithoutDeserializing(node *yaml.Node, jsonPath string) ([]*yaml.No
jsonPath = FixContext(jsonPath)

path, err := yamlpath.NewPath(jsonPath)

if err != nil {
return nil, err
}

// this can spin out, to lets gatekeep it.
done := make(chan bool)
var results []*yaml.Node
timeout, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
timeout, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond)
defer cancel()
go func(d chan bool) {
results, _ = path.Find(node)
Expand Down

0 comments on commit 9d9ff8a

Please sign in to comment.