ratelimit: allow flushing all default values

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2024-06-07 09:38:55 +02:00
parent 5b168597de
commit 470983bba3
2 changed files with 9 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ add_rate() {
reload_service() {
logger ratelimit reload
ubus call ratelimit flush
config_load ratelimit
config_foreach add_rate rate
}

View File

@@ -212,6 +212,14 @@ function run_service() {
let uctx = ubus.connect();
uctx.publish("ratelimit", {
flush: {
call: function(req) {
defaults = {};
},
args: {
}
},
defaults_set: {
call: function(req) {
let r_i = req.args.rate_ingress ?? req.args.rate;