Skip to content

Commit

Permalink
fix: no instances handling in Rest collector (#3358)
Browse files Browse the repository at this point in the history
* fix: no instances handling in Rest collector
  • Loading branch information
rahulguptajss authored Dec 5, 2024
1 parent d06a0e4 commit bb6faf6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cmd/tools/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,15 +483,12 @@ func FetchAllStream(client *Client, href string, processBatch func([]gjson.Resul

output := gjson.ParseBytes(response)
data := output.Get("records")
numRecords := output.Get("num_records")
next := output.Get("_links.next.href")

if data.Exists() {
if numRecords.Int() > 0 {
// Process the current batch of records
if err := processBatch(data.Array()); err != nil {
return err
}
// Process the current batch of records
if err := processBatch(data.Array()); err != nil {
return err
}

prevLink = nextLink
Expand Down

0 comments on commit bb6faf6

Please sign in to comment.