Software /
code /
prosody
Diff
plugins/mod_blocklist.lua @ 13213:50324f66ca2a
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
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 17 Jul 2023 01:38:54 +0200 |
parent | 12977:74b9e05af71e |
line wrap: on
line diff
--- a/plugins/mod_blocklist.lua Mon Jul 17 00:37:44 2023 +0200 +++ b/plugins/mod_blocklist.lua Mon Jul 17 01:38:54 2023 +0200 @@ -35,7 +35,7 @@ -- 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 = {};