# HG changeset patch # User Kim Alvefur # Date 1612112195 -3600 # Node ID 5b3ad3c7fe478decc9d18fe83ee89488a52c75dc # Parent 315faec1a920fbdf4dad84dd6a66bda5bbedefaf mod_http_file_share: Split out some variables for later reuse diff -r 315faec1a920 -r 5b3ad3c7fe47 plugins/mod_http_file_share.lua --- a/plugins/mod_http_file_share.lua Sun Jan 31 14:43:42 2021 +0100 +++ b/plugins/mod_http_file_share.lua Sun Jan 31 17:56:35 2021 +0100 @@ -70,7 +70,9 @@ -- 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