# HG changeset patch # User Kim Alvefur # Date 1631440042 -7200 # Node ID f0971a9eba887769ec5953d735ad4faac32f5347 # Parent 7bf246e6792bde17e97aacad4b517bd87404de89 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. diff -r 7bf246e6792b -r f0971a9eba88 plugins/mod_http_file_share.lua --- a/plugins/mod_http_file_share.lua Sun Sep 12 11:46:32 2021 +0200 +++ b/plugins/mod_http_file_share.lua Sun Sep 12 11:47:22 2021 +0200 @@ -452,7 +452,9 @@ 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 @@ 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