aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-07-21 18:28:54 +0200
committerKim Alvefur <zash@zash.se>2023-07-21 18:28:54 +0200
commitcd5b2664bedeff9f27fae042e086ffdb40890c5d (patch)
treec8c1fecd87886b4334cc8715e4f872f8691c39f6
parent1312963f73ba911122597b2b84c0d41eaff50d94 (diff)
downloadprosody-cd5b2664bedeff9f27fae042e086ffdb40890c5d.tar.gz
prosody-cd5b2664bedeff9f27fae042e086ffdb40890c5d.zip
util.datamanager: Close file handle when done using it
It gets closed eventually but at high load they could potentially lead to reaching FD limits faster.
-rw-r--r--util/datamanager.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua
index 35ce09a4..3a6a462f 100644
--- a/util/datamanager.lua
+++ b/util/datamanager.lua
@@ -361,6 +361,7 @@ local function build_list_index(username, host, datastore, items)
-- so we need to collect the "current" position at the end of the previous
prev_pos = fh:seek()
end
+ fh:close();
if prev_pos ~= 0 then
t_insert(items, { start = last_item_start; length = prev_pos - last_item_start });
end