diff options
author | Christian Schneider | 2025-07-08 09:39:51 +0200 |
---|---|---|
committer | Christian Schneider | 2025-07-08 09:39:51 +0200 |
commit | ac0e96057ffaa1d1f6fdc074ff93fa8da7857036 (patch) | |
tree | 4bfc3d11733210594aba65623696789022ba3764 /it_url.class | |
parent | 90ce3f5d377259825e68aee4e2a5508380a17e9c (diff) | |
download | itools-ac0e96057ffaa1d1f6fdc074ff93fa8da7857036.tar.gz itools-ac0e96057ffaa1d1f6fdc074ff93fa8da7857036.tar.bz2 itools-ac0e96057ffaa1d1f6fdc074ff93fa8da7857036.zip |
Use float to store maxage in minutes as we have maxage < 60 and want to avoid 0, 'find' works with floats tooHEADmaster
Diffstat (limited to 'it_url.class')
-rw-r--r-- | it_url.class | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/it_url.class b/it_url.class index 7321d06..d37a6d5 100644 --- a/it_url.class +++ b/it_url.class @@ -708,7 +708,7 @@ static function get_cache($p = array()) $isnight = date('H') >= 1 && date('H')*3600 + date('i')*60 < $p['cleanbefore']; if (time() - @filemtime($p['cachedir'] . "/cleaned") > ($isnight ? 80000 : 2*80000)) { - $maxagemin = intval($p['maxage']/60); + $maxagemin = round($p['maxage']/60, 2); it::file_put($p['cachedir'] . "/cleaned", "$maxagemin\n"); exec("nohup bash -c 'cd {$p['cachedir']} && for i in [0-9a-f][0-9a-f]; do sleep 20; ionice -c 3 find \$i -mmin +$maxagemin -type f -delete; done' </dev/null >/dev/null 2>&1 &"); } |