# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1612300313 -3600
# Node ID 43e5429ab35593470dba477587e502e4f49706b4
# Parent  89efa3f2966b5ac2172fd2d0f18c4b377f6a7ed6
mod_http_file_share: Measure how long it takes to prune expired files

diff -r 89efa3f2966b -r 43e5429ab355 plugins/mod_http_file_share.lua
--- a/plugins/mod_http_file_share.lua	Tue Feb 02 22:08:51 2021 +0100
+++ b/plugins/mod_http_file_share.lua	Tue Feb 02 22:11:53 2021 +0100
@@ -354,9 +354,11 @@
 
 	local reaper_task = async.runner(function(boundary_time)
 		local iter, total = assert(uploads:find(nil, {["end"] = boundary_time; total = true}));
+		local prune_done = module:measure("prune", "times");
 
 		if total == 0 then
 			module:log("info", "No expired uploaded files to prune");
+			prune_done();
 			return;
 		end
 
@@ -400,6 +402,7 @@
 			module:log("error", "Problem removing metadata for deleted files: %s", err);
 		end
 
+		prune_done();
 	end);
 
 	module:add_timer(1, function ()