|
@@ -3,6 +3,7 @@ package setting
|
|
|
import (
|
|
import (
|
|
|
"encoding/json"
|
|
"encoding/json"
|
|
|
"fmt"
|
|
"fmt"
|
|
|
|
|
+ "math"
|
|
|
"one-api/common"
|
|
"one-api/common"
|
|
|
"sync"
|
|
"sync"
|
|
|
)
|
|
)
|
|
@@ -58,7 +59,7 @@ func CheckModelRequestRateLimitGroup(jsonStr string) error {
|
|
|
if limits[0] < 0 || limits[1] < 1 {
|
|
if limits[0] < 0 || limits[1] < 1 {
|
|
|
return fmt.Errorf("group %s has negative rate limit values: [%d, %d]", group, limits[0], limits[1])
|
|
return fmt.Errorf("group %s has negative rate limit values: [%d, %d]", group, limits[0], limits[1])
|
|
|
}
|
|
}
|
|
|
- if limits[0] > 2147483647 || limits[1] > 2147483647 {
|
|
|
|
|
|
|
+ if limits[0] > math.MaxInt32 || limits[1] > math.MaxInt32 {
|
|
|
return fmt.Errorf("group %s [%d, %d] has max rate limits value 2147483647", group, limits[0], limits[1])
|
|
return fmt.Errorf("group %s [%d, %d] has max rate limits value 2147483647", group, limits[0], limits[1])
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|