Software /
code /
prosody
Comparison
plugins/mod_http_file_share.lua @ 12003:121c0401f83e
mod_http_file_share: Recalculate total storage usage weekly instead of daily
Before mod_cron this job ran less frequently than the upload removal
job. Running them at the same frequency seems wasteful somehow, plus the
total should not drift away from the true value that fast.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 03 Dec 2021 09:08:23 +0100 |
parent | 11999:9d2eab56f124 |
child | 12004:a2a0e00cbd24 |
comparison
equal
deleted
inserted
replaced
12002:cbed7d8d8f35 | 12003:121c0401f83e |
---|---|
536 end | 536 end |
537 | 537 |
538 if total_storage_limit then | 538 if total_storage_limit then |
539 local summary_start = module:measure("summary", "times"); | 539 local summary_start = module:measure("summary", "times"); |
540 | 540 |
541 module:daily("Global quota check", function() | 541 module:weekly("Global quota check", function() |
542 local summary_done = summary_start(); | 542 local summary_done = summary_start(); |
543 local iter = assert(uploads:find(nil)); | 543 local iter = assert(uploads:find(nil)); |
544 | 544 |
545 local count, sum = 0, 0; | 545 local count, sum = 0, 0; |
546 for _, file in iter do | 546 for _, file in iter do |