diff options
author | Kim Alvefur <zash@zash.se> | 2021-01-31 17:56:35 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-01-31 17:56:35 +0100 |
commit | 12a72e28dcbd2dd27f9f90d957bd8528c4658c1d (patch) | |
tree | b937b130328363d894dd0109e333a30f7eed7a87 | |
parent | 55cb283433026ad2b04597090ff0a730e8c93f57 (diff) | |
download | prosody-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.lua | 4 |
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 |