MCPcopy Create free account
hub / github.com/bytebase/bytebase / parseDocCount

Function parseDocCount

backend/plugin/db/elasticsearch/sync.go:340–346  ·  view source on GitHub ↗

parseDocCount parses document count string, returning 0 for empty values (e.g., closed indices).

(s string)

Source from the content-addressed store, hash-verified

338
339// parseDocCount parses document count string, returning 0 for empty values (e.g., closed indices).
340func parseDocCount(s string) (int64, error) {
341 if s == "" {
342 return 0, nil
343 }
344 count, err := strconv.Atoi(s)
345 return int64(count), err
346}
347
348func unitConversion(sizeWithUnit string) (int64, error) {
349 // Empty size is expected for closed indices (ES returns null → unmarshals to "")

Callers 1

getIndicesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected