From 71ad48095d92dd52a415eef499da32f8c27bb7fe Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 17 Jul 2023 01:38:54 +0200 Subject: plugins: Use integer config API with interval specification where sensible Many of these fall into a few categories: - util.cache size, must be >= 1 - byte or item counts that logically can't be negative - port numbers that should be in 1..0xffff --- plugins/mod_blocklist.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/mod_blocklist.lua') diff --git a/plugins/mod_blocklist.lua b/plugins/mod_blocklist.lua index c6be198b..d1b41111 100644 --- a/plugins/mod_blocklist.lua +++ b/plugins/mod_blocklist.lua @@ -35,7 +35,7 @@ local cache = setmetatable({}, { __mode = "v" }); -- disk, which we want to avoid during routing. On the other hand, we don't -- want to use too much memory either, so this can be tuned by advanced -- users. TODO use science to figure out a better default, 64 is just a guess. -local cache_size = module:get_option_number("blocklist_cache_size", 64); +local cache_size = module:get_option_integer("blocklist_cache_size", 64, 1); local cache2 = require"prosody.util.cache".new(cache_size); local null_blocklist = {}; -- cgit v1.2.3