Software /
code /
prosody
Changeset
13545:7f05254fb042
mod_http_file_share: Revert 9c62ffbdf2ae
No, that wasn't running in a thread, but in a next tick timer.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 02 Nov 2024 23:08:28 +0100 |
parents | 13544:0aae6de9d323 |
children | 13548:84ee435f284e |
files | plugins/mod_http_file_share.lua |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_http_file_share.lua Sat Nov 02 22:33:38 2024 +0100 +++ b/plugins/mod_http_file_share.lua Sat Nov 02 23:08:28 2024 +0100 @@ -79,12 +79,12 @@ local measure_quota_cache_size = module:measure("quota_cache", "amount"); local measure_total_storage_usage = module:measure("total_storage", "amount", { unit = "bytes" }); -module:on_ready(function () +do local total, err = persist_stats:get(nil, "total"); if not err then total_storage_usage = tonumber(total) or 0; end -end) +end module:hook_global("stats-update", function () measure_upload_cache_size(upload_cache:count());