Mercurial > prosody-hg
comparison plugins/mod_http_file_share.lua @ 12008:c01532ae6a3b
mod_http_file_share: Fix to take retention time into account
It was lost in 6f4790b8deec when switching to mod_cron.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 04 Dec 2021 16:48:39 +0100 |
| parents | dc72581e04ff |
| children | 5e68635cdc2c |
comparison
equal
deleted
inserted
replaced
| 12007:dc72581e04ff | 12008:c01532ae6a3b |
|---|---|
| 458 wait(); | 458 wait(); |
| 459 end | 459 end |
| 460 | 460 |
| 461 local prune_start = module:measure("prune", "times"); | 461 local prune_start = module:measure("prune", "times"); |
| 462 | 462 |
| 463 module:daily("Remove expired files", function(_, boundary_time) | 463 module:daily("Remove expired files", function(_, current_time) |
| 464 local prune_done = prune_start(); | 464 local prune_done = prune_start(); |
| 465 local boundary_time = (current_time or os.time()) - expiry; | |
| 465 local iter, total = assert(uploads:find(nil, {["end"] = boundary_time; total = true})); | 466 local iter, total = assert(uploads:find(nil, {["end"] = boundary_time; total = true})); |
| 466 | 467 |
| 467 if total == 0 then | 468 if total == 0 then |
| 468 module:log("info", "No expired uploaded files to prune"); | 469 module:log("info", "No expired uploaded files to prune"); |
| 469 prune_done(); | 470 prune_done(); |
