From cd5b2664bedeff9f27fae042e086ffdb40890c5d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 21 Jul 2023 18:28:54 +0200 Subject: 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. --- util/datamanager.lua | 1 + 1 file changed, 1 insertion(+) 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 -- cgit v1.2.3