mod_http_file_share: Recalculate total storage usage weekly instead of daily
authorKim Alvefur <zash@zash.se>
Fri, 03 Dec 2021 09:08:23 +0100
changeset 12007 121c0401f83e
parent 12006 cbed7d8d8f35
child 12008 a2a0e00cbd24
mod_http_file_share: Recalculate total storage usage weekly instead of daily Before mod_cron this job ran less frequently than the upload removal job. Running them at the same frequency seems wasteful somehow, plus the total should not drift away from the true value that fast.
plugins/mod_http_file_share.lua
--- a/plugins/mod_http_file_share.lua	Fri Dec 03 09:05:41 2021 +0100
+++ b/plugins/mod_http_file_share.lua	Fri Dec 03 09:08:23 2021 +0100
@@ -538,7 +538,7 @@
 if total_storage_limit then
 	local summary_start = module:measure("summary", "times");
 
-	module:daily("Global quota check", function()
+	module:weekly("Global quota check", function()
 		local summary_done = summary_start();
 		local iter = assert(uploads:find(nil));