mod_http_file_share: Fix measuring total storage use before it was known
authorKim Alvefur <zash@zash.se>
Fri, 03 Dec 2021 08:16:18 +0100
changeset 12002 99be6874340b
parent 12001 1ea01660c79a
child 12003 9d2eab56f124
mod_http_file_share: Fix measuring total storage use before it was known Passing nil to the metrics system causes errors later.
plugins/mod_http_file_share.lua
--- a/plugins/mod_http_file_share.lua	Fri Dec 03 01:02:02 2021 +0100
+++ b/plugins/mod_http_file_share.lua	Fri Dec 03 08:16:18 2021 +0100
@@ -78,7 +78,7 @@
 module:hook_global("stats-update", function ()
 	measure_upload_cache_size(upload_cache:count());
 	measure_quota_cache_size(quota_cache:count());
-	if total_storage_limit then
+	if total_storage_limit and total_storage_usage then
 		measure_total_storage_usage(total_storage_usage);
 	end
 end);