aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_http_file_share.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-12-04 15:03:52 +0100
committerKim Alvefur <zash@zash.se>2021-12-04 15:03:52 +0100
commit7a1198b7278e51a16ac8b1bbffea131faa9d1723 (patch)
tree4a5a20ba83d29c551e9acf8c8484b385a1337d41 /plugins/mod_http_file_share.lua
parent3e7177a533d7b97c09b20dd489a11182e0e6c208 (diff)
downloadprosody-7a1198b7278e51a16ac8b1bbffea131faa9d1723.tar.gz
prosody-7a1198b7278e51a16ac8b1bbffea131faa9d1723.zip
mod_http_file_share: Rename variable for clarity
Diffstat (limited to 'plugins/mod_http_file_share.lua')
-rw-r--r--plugins/mod_http_file_share.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/mod_http_file_share.lua b/plugins/mod_http_file_share.lua
index 61f670b7..718ffb99 100644
--- a/plugins/mod_http_file_share.lua
+++ b/plugins/mod_http_file_share.lua
@@ -478,11 +478,11 @@ if expiry >= 0 and not external_base_url then
end
local obsolete_uploads = array();
- local n = 0;
+ local num_expired = 0;
local size_sum = 0;
local problem_deleting = false;
for slot_id, slot_info in iter do
- n = n + 1;
+ num_expired = num_expired + 1;
upload_cache:set(slot_id, nil);
local filename = get_filename(slot_id);
local deleted, err, errno = os.remove(filename);
@@ -493,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 n % 100 == 0 then sleep(0.1); end
+ if num_expired % 100 == 0 then sleep(0.1); end
end
-- obsolete_uploads now contains slot ids for which the files have been
@@ -501,10 +501,10 @@ if expiry >= 0 and not external_base_url then
local deletion_query = {["end"] = boundary_time};
if not problem_deleting then
- module:log("info", "All (%d, %s) expired files successfully deleted", n, B(size_sum));
+ module:log("info", "All (%d, %s) expired files successfully deleted", num_expired, B(size_sum));
-- we can delete based on time
else
- module:log("warn", "%d out of %d expired files could not be deleted", n-#obsolete_uploads, n);
+ module:log("warn", "%d out of %d expired files could not be deleted", num_expired-#obsolete_uploads, num_expired);
-- we'll need to delete only those entries where the files were
-- successfully deleted, and then try again with the failed ones.
-- eventually the admin ought to notice and fix the permissions or
@@ -523,7 +523,7 @@ if expiry >= 0 and not external_base_url then
else
local removed, err = uploads:delete(nil, deletion_query);
- if removed == true or removed == n or removed == #obsolete_uploads then
+ if removed == true or removed == num_expired or removed == #obsolete_uploads then
module:log("debug", "Removed all metadata for expired uploaded files");
else
module:log("error", "Problem removing metadata for deleted files: %s", err);