Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions ingestors/csfloat/csfloat.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"hash/fnv"
"net/http"
"strconv"
"time"

"reverse-watch/config"
Expand Down Expand Up @@ -54,7 +55,7 @@ type slimWarning struct {

type responseData struct {
Data []*slimWarning `json:"data"`
NextCursor *uint `json:"next_cursor"`
NextCursor *string `json:"next_cursor"`
}

type errorResponse struct {
Expand Down Expand Up @@ -102,7 +103,16 @@ func (i *csfloatIngestor) fetch(ctx context.Context, cursor *uint) ([]*slimWarni
return nil, nil, errors.New(errors.JSONDecode, err.Error())
}

return data.Data, data.NextCursor, nil
var nextCursor *uint
if data.NextCursor != nil {
next, err := strconv.ParseUint(*data.NextCursor, 10, 64)
if err != nil {
return nil, nil, errors.New(errors.JSONDecode, err.Error())
}
nextCursor = util.Ptr(uint(next))
}

return data.Data, nextCursor, nil
}

// process warnings and create reversals, returns the most recent reversal
Expand Down
Loading