Skip to content

Commit

Permalink
feat: yocsef api
Browse files Browse the repository at this point in the history
  • Loading branch information
JingYiJun committed May 24, 2024
1 parent 9fd3858 commit d191aca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions service/yocsef.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,12 @@ func InferYocsef(
if err != nil {
return nil, err
}
line = bytes.Trim(line, " \n\r")
if strings.HasPrefix(string(line), "event") {
continue
}
if strings.HasPrefix(string(line), "data") {
line = line[6:]
line = bytes.TrimPrefix(line, []byte("data:"))
}
line = bytes.Trim(line, " \n\r")
if len(line) == 0 {
Expand All @@ -98,7 +99,7 @@ func InferYocsef(
var response map[string]any
err = json.Unmarshal(line, &response)
if err != nil {
return nil, err
continue
}

var ok bool
Expand Down

0 comments on commit d191aca

Please sign in to comment.