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 | 855542e2ca65ed12635ff0e4835365b971070033 (patch) | |
tree | b937b130328363d894dd0109e333a30f7eed7a87 /plugins | |
parent | 4d3ffbf0f73b68ed8a201d8cfb05e071a266ba17 (diff) | |
download | prosody-855542e2ca65ed12635ff0e4835365b971070033.tar.gz prosody-855542e2ca65ed12635ff0e4835365b971070033.zip |
mod_http_file_share: Split out some variables for later reuse
Diffstat (limited to 'plugins')
-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 |