aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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