feat(ratelimit): Create rate limits from configs
This commit is contained in:
6 files changed
+684
-11
No files matched your search
@@ -693,7 +693,7 @@ func Parse(d string) (*Config, error) {
|
||||
}
|
||||
|
||||
if result.Controller.ApiRateLimiterMaxEntries <= 0 {
|
||||
result.Controller.ApiRateLimiterMaxEntries = ratelimit.DefaultLimiterMaxEntries
|
||||
result.Controller.ApiRateLimiterMaxEntries = ratelimit.DefaultLimiterMaxEntries()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -419,7 +419,7 @@ func TestLoad(t *testing.T) {
|
||||
WorkerStatusGracePeriodDuration: 0,
|
||||
LivenessTimeToStaleDuration: 0,
|
||||
ApiRateLimits: make(ratelimit.Configs, 0),
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries,
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries(),
|
||||
},
|
||||
DevController: false,
|
||||
DevUiPassthroughDir: "",
|
||||
@@ -844,7 +844,7 @@ func TestLoad(t *testing.T) {
|
||||
WorkerStatusGracePeriodDuration: 0,
|
||||
LivenessTimeToStaleDuration: 0,
|
||||
ApiRateLimits: make(ratelimit.Configs, 0),
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries,
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries(),
|
||||
},
|
||||
DevController: false,
|
||||
DevUiPassthroughDir: "",
|
||||
@@ -1283,7 +1283,7 @@ func TestLoad(t *testing.T) {
|
||||
Unlimited: false,
|
||||
},
|
||||
},
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries,
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries(),
|
||||
},
|
||||
DevController: false,
|
||||
DevUiPassthroughDir: "",
|
||||
@@ -1703,7 +1703,7 @@ func TestLoad(t *testing.T) {
|
||||
WorkerStatusGracePeriodDuration: 0,
|
||||
LivenessTimeToStaleDuration: 0,
|
||||
ApiRateLimits: make(ratelimit.Configs, 0),
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries,
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries(),
|
||||
},
|
||||
DevController: false,
|
||||
DevUiPassthroughDir: "",
|
||||
@@ -1794,7 +1794,7 @@ func TestLoad(t *testing.T) {
|
||||
WorkerStatusGracePeriodDuration: 0,
|
||||
LivenessTimeToStaleDuration: 0,
|
||||
ApiRateLimits: make(ratelimit.Configs, 0),
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries,
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries(),
|
||||
},
|
||||
DevController: false,
|
||||
DevUiPassthroughDir: "",
|
||||
|
||||
@@ -113,7 +113,7 @@ func TestDevController(t *testing.T) {
|
||||
Name: "dev-controller",
|
||||
Description: "A default controller created in dev mode",
|
||||
ApiRateLimits: make(ratelimit.Configs, 0),
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries,
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries(),
|
||||
},
|
||||
DevController: true,
|
||||
}
|
||||
@@ -488,7 +488,7 @@ func TestDevCombined(t *testing.T) {
|
||||
Name: "dev-controller",
|
||||
Description: "A default controller created in dev mode",
|
||||
ApiRateLimits: make(ratelimit.Configs, 0),
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries,
|
||||
ApiRateLimiterMaxEntries: ratelimit.DefaultLimiterMaxEntries(),
|
||||
},
|
||||
DevController: true,
|
||||
Worker: &Worker{
|
||||
|
||||
Reference in new issue
Block a user