Mercurial > prosody-hg
comparison plugins/mod_storage_memory.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 |
| parents | 74b9e05af71e |
| children | 159047a453f2 |
comparison
equal
deleted
inserted
replaced
| 13212:3e6e98cc63e9 | 13213:50324f66ca2a |
|---|---|
| 7 local set = require "prosody.util.set"; | 7 local set = require "prosody.util.set"; |
| 8 | 8 |
| 9 local auto_purge_enabled = module:get_option_boolean("storage_memory_temporary", false); | 9 local auto_purge_enabled = module:get_option_boolean("storage_memory_temporary", false); |
| 10 local auto_purge_stores = module:get_option_set("storage_memory_temporary_stores", {}); | 10 local auto_purge_stores = module:get_option_set("storage_memory_temporary_stores", {}); |
| 11 | 11 |
| 12 local archive_item_limit = module:get_option_number("storage_archive_item_limit", 1000); | 12 local archive_item_limit = module:get_option_integer("storage_archive_item_limit", 1000, 0); |
| 13 | 13 |
| 14 local memory = setmetatable({}, { | 14 local memory = setmetatable({}, { |
| 15 __index = function(t, k) | 15 __index = function(t, k) |
| 16 local store = module:shared(k) | 16 local store = module:shared(k) |
| 17 t[k] = store; | 17 t[k] = store; |
