MCPcopy Create free account
hub / github.com/cortexproject/cortex / parseRequestBrokenJSON

Function parseRequestBrokenJSON

pkg/util/request_tracker/request_tracker.go:44–55  ·  view source on GitHub ↗
(brokenJSON []byte)

Source from the content-addressed store, hash-verified

42)
43
44func parseRequestBrokenJSON(brokenJSON []byte) (string, bool) {
45 requests := strings.ReplaceAll(string(brokenJSON), "\x00", "")
46 if len(requests) > 0 {
47 requests = requests[:len(requests)-1] + "]"
48 }
49
50 if len(requests) <= 1 {
51 return "[]", false
52 }
53
54 return requests, true
55}
56
57func logUnfinishedRequests(filename string, filesize int, logger *slog.Logger) {
58 if _, err := os.Stat(filename); err == nil {

Callers 1

logUnfinishedRequestsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected