comparison plugins/mod_http_file_share.lua @ 13362:11e66ad894f0

luacheckrc, mod_http_file_share: Update for module API change (once->on_ready)
author Matthew Wild <mwild1@gmail.com>
date Thu, 30 Nov 2023 10:14:17 +0000
parents 9c62ffbdf2ae
children fe7557cf31a6
comparison
equal deleted inserted replaced
13361:e20949a10118 13362:11e66ad894f0
77 77
78 local measure_upload_cache_size = module:measure("upload_cache", "amount"); 78 local measure_upload_cache_size = module:measure("upload_cache", "amount");
79 local measure_quota_cache_size = module:measure("quota_cache", "amount"); 79 local measure_quota_cache_size = module:measure("quota_cache", "amount");
80 local measure_total_storage_usage = module:measure("total_storage", "amount", { unit = "bytes" }); 80 local measure_total_storage_usage = module:measure("total_storage", "amount", { unit = "bytes" });
81 81
82 module:once(function () 82 module:on_ready(function ()
83 local total, err = persist_stats:get(nil, "total"); 83 local total, err = persist_stats:get(nil, "total");
84 if not err then 84 if not err then
85 total_storage_usage = tonumber(total) or 0; 85 total_storage_usage = tonumber(total) or 0;
86 end 86 end
87 end) 87 end)