mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-12-05 21:01:50 +08:00
fix: enforce strict LLM HTTP request rate limits
This commit is contained in:
1 parent
23446606a4
commit
bfc5e6236e
5 files changed
+656
-21
No files matched your search
@@ -0,0 +1,15 @@
|
||||
package server
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestProfileRequestLimiterSurvivesCacheInvalidation(t *testing.T) {
|
||||
s := &Server{}
|
||||
limiter := s.requestLimiterForProfile(1)
|
||||
if limiter == s.requestLimiterForProfile(2) || limiter == s.requestLimiterForProfile(0) {
|
||||
t.Fatal("different profiles must have independent quotas")
|
||||
}
|
||||
s.invalidateProfileAgents()
|
||||
if got := s.requestLimiterForProfile(1); got != limiter {
|
||||
t.Fatal("clearing providers reset the profile's rate limiter")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user