aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-01-31 17:56:35 +0100
committerKim Alvefur <zash@zash.se>2021-01-31 17:56:35 +0100
commit12a72e28dcbd2dd27f9f90d957bd8528c4658c1d (patch)
treeb937b130328363d894dd0109e333a30f7eed7a87
parent55cb283433026ad2b04597090ff0a730e8c93f57 (diff)
downloadprosody-12a72e28dcbd2dd27f9f90d957bd8528c4658c1d.tar.gz
prosody-12a72e28dcbd2dd27f9f90d957bd8528c4658c1d.zip
mod_http_file_share: Split out some variables for later reuse
-rw-r--r--plugins/mod_http_file_share.lua4
1 files changed, 3 insertions, 1 deletions
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