plugin: reload IP filter plugin on demand

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2022-03-24 10:21:13 +01:00
parent a193089646
commit 4bbb195711
9 changed files with 89 additions and 70 deletions

View File

@@ -209,8 +209,9 @@ func LimitRate(protocol, ip string) (time.Duration, error) {
return 0, nil
}
// Reload reloads the whitelist and the defender's block and safe lists
// Reload reloads the whitelist, the IP filter plugin and the defender's block and safe lists
func Reload() error {
plugin.Handler.ReloadFilter()
var errWithelist error
if Config.whitelist != nil {
errWithelist = Config.whitelist.reload()