Diff

plugins/mod_http_file_share.lua @ 12008:c01532ae6a3b

mod_http_file_share: Fix to take retention time into account It was lost in 6f4790b8deec when switching to mod_cron.
author Kim Alvefur <zash@zash.se>
date Sat, 04 Dec 2021 16:48:39 +0100
parent 12007:dc72581e04ff
child 12179:5e68635cdc2c
line wrap: on
line diff
--- 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