MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / CacheRatio2JSONString

Function CacheRatio2JSONString

setting/ratio_setting/cache_ratio.go:73–81  ·  view source on GitHub ↗

CacheRatio2JSONString converts the cache ratio map to a JSON string

()

Source from the content-addressed store, hash-verified

71
72// CacheRatio2JSONString converts the cache ratio map to a JSON string
73func CacheRatio2JSONString() string {
74 cacheRatioMapMutex.RLock()
75 defer cacheRatioMapMutex.RUnlock()
76 jsonBytes, err := json.Marshal(cacheRatioMap)
77 if err != nil {
78 common.SysError("error marshalling cache ratio: " + err.Error())
79 }
80 return string(jsonBytes)
81}
82
83// UpdateCacheRatioByJSONString updates the cache ratio map from a JSON string
84func UpdateCacheRatioByJSONString(jsonStr string) error {

Callers 1

InitOptionMapFunction · 0.92

Calls 2

SysErrorFunction · 0.92
ErrorMethod · 0.80

Tested by

no test coverage detected