aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-09-12 11:47:22 +0200
committerKim Alvefur <zash@zash.se>2021-09-12 11:47:22 +0200
commit5392ef1dd6c44928b3cf5a42460dbb8f41cace0e (patch)
treec78b7ab82bea2c856185f54fc3100adcfe31a70f /plugins
parenta281376b37104e38da658cb1db123930911f047a (diff)
downloadprosody-5392ef1dd6c44928b3cf5a42460dbb8f41cace0e.tar.gz
prosody-5392ef1dd6c44928b3cf5a42460dbb8f41cace0e.zip
mod_http_file_share: Fix traceback in global quota debug logging (thanks Martin)
Error in util.human.units.format because of B(nil) when the global quota is unset.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_http_file_share.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/mod_http_file_share.lua b/plugins/mod_http_file_share.lua
index ef6da4a1..c18187cd 100644
--- a/plugins/mod_http_file_share.lua
+++ b/plugins/mod_http_file_share.lua
@@ -452,7 +452,9 @@ if expiry >= 0 and not external_base_url then
end
module:log("info", "Pruning expired files uploaded earlier than %s", dt.datetime(boundary_time));
- module:log("debug", "Global quota %s / %s", B(total_storage_usage), B(total_storage_limit));
+ if total_storage_limit then
+ module:log("debug", "Global quota %s / %s", B(total_storage_usage), B(total_storage_limit));
+ end
local obsolete_uploads = array();
local i = 0;
@@ -488,7 +490,7 @@ if expiry >= 0 and not external_base_url then
module:log("info", "All (%d, %s) expired files successfully deleted", n, B(size_sum));
if total_storage_usage then
total_storage_usage = total_storage_usage - size_sum;
- module:log("debug", "Global quota %s / %s", B(total_storage_usage), B(total_storage_limit));
+ module:log("debug", "Global quota %s / %s", B(total_storage_usage), B(total_storage_limit));
end
-- we can delete based on time
else