aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_http_file_share.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-12-04 14:28:04 +0100
committerKim Alvefur <zash@zash.se>2021-12-04 14:28:04 +0100
commit3e7177a533d7b97c09b20dd489a11182e0e6c208 (patch)
tree08156877ff6c80baeee9ae41e2fe16ac6811ed48 /plugins/mod_http_file_share.lua
parentd4f8f23818968542dce146baf2144421fdecb653 (diff)
downloadprosody-3e7177a533d7b97c09b20dd489a11182e0e6c208.tar.gz
prosody-3e7177a533d7b97c09b20dd489a11182e0e6c208.zip
mod_http_file_share: Fix deletion counter
Before aa60f4353001 each loop had its own counter, seems incrementing of one of them was lost. But only one is needed anyhow.
Diffstat (limited to 'plugins/mod_http_file_share.lua')
-rw-r--r--plugins/mod_http_file_share.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/plugins/mod_http_file_share.lua b/plugins/mod_http_file_share.lua
index 3807e87e..61f670b7 100644
--- a/plugins/mod_http_file_share.lua
+++ b/plugins/mod_http_file_share.lua
@@ -478,12 +478,11 @@ if expiry >= 0 and not external_base_url then
end
local obsolete_uploads = array();
- local i = 0;
- local size_sum = 0;
local n = 0;
+ local size_sum = 0;
local problem_deleting = false;
for slot_id, slot_info in iter do
- i = i + 1;
+ n = n + 1;
upload_cache:set(slot_id, nil);
local filename = get_filename(slot_id);
local deleted, err, errno = os.remove(filename);
@@ -494,7 +493,7 @@ if expiry >= 0 and not external_base_url then
module:log("error", "Could not delete file %q: %s", filename, err);
problem_deleting = true;
end
- if i % 100 == 0 then sleep(0.1); end
+ if n % 100 == 0 then sleep(0.1); end
end
-- obsolete_uploads now contains slot ids for which the files have been