From 855542e2ca65ed12635ff0e4835365b971070033 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 31 Jan 2021 17:56:35 +0100 Subject: mod_http_file_share: Split out some variables for later reuse --- plugins/mod_http_file_share.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_http_file_share.lua b/plugins/mod_http_file_share.lua index 63bb7193..47a060a1 100644 --- a/plugins/mod_http_file_share.lua +++ b/plugins/mod_http_file_share.lua @@ -70,7 +70,9 @@ end -- TODO cache function get_daily_quota(uploader) - local iter, err = uploads:find(nil, {with = uploader; start = os.time() - 86400}); + local now = os.time(); + local max_age = now - 86400; + local iter, err = uploads:find(nil, {with = uploader; start = max_age }); if not iter then return iter, err; end local total_bytes = 0; for _, slot in iter do -- cgit v1.2.3