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

Function CheckModelRequestRateLimitGroup

setting/rate_limit.go:51–64  ·  view source on GitHub ↗
(jsonStr string)

Source from the content-addressed store, hash-verified

49}
50
51func CheckModelRequestRateLimitGroup(jsonStr string) error {
52 checkModelRequestRateLimitGroup := make(map[string][2]int)
53 err := json.Unmarshal([]byte(jsonStr), &checkModelRequestRateLimitGroup)
54 if err != nil {
55 return err
56 }
57 for group, limits := range checkModelRequestRateLimitGroup {
58 if limits[0] < 0 || limits[1] < 1 {
59 return fmt.Errorf("group %s has negative rate limit values: [%d, %d]", group, limits[0], limits[1])
60 }
61 }
62
63 return nil
64}

Callers 1

UpdateOptionFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected