Diff

mod_pubsub_feeds/mod_pubsub_feeds.lua @ 793:9fd30261b0e1

mod_pubsub_feeds: Add parameter refresh_feeds() to force refresh of all feeds
author Kim Alvefur <zash@zash.se>
date Wed, 15 Aug 2012 16:34:59 +0200
parent 792:db27f07342d4
child 794:5a8fa70faa13
line wrap: on
line diff
--- a/mod_pubsub_feeds/mod_pubsub_feeds.lua	Wed Aug 15 16:31:27 2012 +0200
+++ b/mod_pubsub_feeds/mod_pubsub_feeds.lua	Wed Aug 15 16:34:59 2012 +0200
@@ -138,13 +138,13 @@
 	end);
 end
 
-function refresh_feeds()
+function refresh_feeds(force)
 	local now = time();
 	--module:log("debug", "Refreshing feeds");
 	for node, item in pairs(feed_list) do
 		--FIXME Don't fetch feeds which have a subscription
 		-- Otoho, what if the subscription expires or breaks?
-		if item.last_update + refresh_interval < now then 
+		if force or item.last_update + refresh_interval < now then 
 			--module:log("debug", "checking %s", item.node);
 			fetch(item, update_entry);
 		end