mod_http_file_share: Fix to take retention time into account
authorKim Alvefur <zash@zash.se>
Sat, 04 Dec 2021 16:48:39 +0100
changeset 12012 c01532ae6a3b
parent 12011 dc72581e04ff
child 12013 f6fff0658108
mod_http_file_share: Fix to take retention time into account It was lost in 6f4790b8deec when switching to mod_cron.
plugins/mod_http_file_share.lua
--- a/plugins/mod_http_file_share.lua	Sat Dec 04 15:03:26 2021 +0100
+++ b/plugins/mod_http_file_share.lua	Sat Dec 04 16:48:39 2021 +0100
@@ -460,8 +460,9 @@
 
 	local prune_start = module:measure("prune", "times");
 
-	module:daily("Remove expired files", function(_, boundary_time)
+	module:daily("Remove expired files", function(_, current_time)
 		local prune_done = prune_start();
+		local boundary_time = (current_time or os.time()) - expiry;
 		local iter, total = assert(uploads:find(nil, {["end"] = boundary_time; total = true}));
 
 		if total == 0 then