# HG changeset patch # User Kim Alvefur # Date 1687715925 -7200 # Node ID e7792188540a4bd4782bd2fa3fc8190173fb450d # Parent c729a38f21b1b2cb49b073ca1ef3b97d4effdc0b mod_pubsub_feeds: Retrieve only the most recent item to compare Only need one item id. Fetching all items probably caused memory usage peaks. diff -r c729a38f21b1 -r e7792188540a mod_pubsub_feeds/mod_pubsub_feeds.lua --- a/mod_pubsub_feeds/mod_pubsub_feeds.lua Sun Jun 25 19:52:24 2023 +0200 +++ b/mod_pubsub_feeds/mod_pubsub_feeds.lua Sun Jun 25 19:58:45 2023 +0200 @@ -81,9 +81,9 @@ for entry in feed:childtags("entry") do table.insert(entries, entry); end - local ok, items = pubsub.service:get_items(node, true); + local ok, last_id = pubsub.service:get_last_item(node, true); if not ok then - module:log("error", "PubSub node %q missing: %s", node, items); + module:log("error", "PubSub node %q missing: %s", node, last_id); return end @@ -102,7 +102,7 @@ entry:text_tag("id", id); end - if items[id] then + if last_id == id then -- This should be the first item that we already have. start_from = i-1; break