Comparison

plugins/mod_pubsub/mod_pubsub.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 13202:173038306750
comparison
equal deleted inserted replaced
13212:3e6e98cc63e9 13213:50324f66ca2a
37 -- A nodestore supports the following methods: 37 -- A nodestore supports the following methods:
38 -- set(node_name, node_data) 38 -- set(node_name, node_data)
39 -- get(node_name) 39 -- get(node_name)
40 -- users(): iterator over (node_name) 40 -- users(): iterator over (node_name)
41 41
42 local max_max_items = module:get_option_number("pubsub_max_items", 256); 42 local max_max_items = module:get_option_integer("pubsub_max_items", 256, 1);
43 43
44 local function tonumber_max_items(n) 44 local function tonumber_max_items(n)
45 if n == "max" then 45 if n == "max" then
46 return max_max_items; 46 return max_max_items;
47 end 47 end