diff options
author | Kim Alvefur <zash@zash.se> | 2021-07-21 23:02:25 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-07-21 23:02:25 +0200 |
commit | 1603e003b144d3ee98d30444665161ebb658cf3f (patch) | |
tree | cd1f91dce39346fa6068eaae2f027696ce056c3b /plugins | |
parent | ffeeffd35c4a274351804d9a8d40b9483830b0b6 (diff) | |
download | prosody-1603e003b144d3ee98d30444665161ebb658cf3f.tar.gz prosody-1603e003b144d3ee98d30444665161ebb658cf3f.zip |
mod_pep: Remove use of RLU cache when persist_items was set to false
This behavior came from some confusion over the meaning of
persist_items. The correct behavior is that items are only stored when
it is set to true. When set to false, the service becomes a "pure"
publish-subscribe service, where items are forgotten immediately after
broadcasting.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_pep.lua | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua index f9e2f808..24c38785 100644 --- a/plugins/mod_pep.lua +++ b/plugins/mod_pep.lua @@ -110,14 +110,9 @@ local function simple_itemstore(username) local driver = storagemanager.get_driver(module.host, "pep_data"); return function (config, node) local max_items = tonumber_max_items(config["max_items"]); - if config["persist_items"] then - module:log("debug", "Creating new persistent item store for user %s, node %q", username, node); - local archive = driver:open("pep_"..node, "archive"); - return lib_pubsub.archive_itemstore(archive, max_items, username, node, false); - else - module:log("debug", "Creating new ephemeral item store for user %s, node %q", username, node); - return cache.new(max_items); - end + module:log("debug", "Creating new persistent item store for user %s, node %q", username, node); + local archive = driver:open("pep_"..node, "archive"); + return lib_pubsub.archive_itemstore(archive, max_items, username, node, false); end end |