From d6a73f40ff8c291207274979e3a575da2ae0c0eb Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Tue, 30 Apr 2024 10:39:32 +0200 Subject: Only delete cache files (not directories) to avoid race with directory creation --- it_url.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it_url.class b/it_url.class index 83ea9fb..abaf9e6 100644 --- a/it_url.class +++ b/it_url.class @@ -701,7 +701,7 @@ static function get_cache($p = array()) { it::file_put($p['cachedir'] . "/cleaned", ""); # touch could have permission problems $maxagemin = intval($p['maxage']/60); - exec("nohup bash -c 'cd {$p['cachedir']} && for i in ??; do sleep 20; ionice -c 3 find \$i -mmin +$maxagemin -delete; done' /dev/null 2>&1 &"); + exec("nohup bash -c 'cd {$p['cachedir']} && for i in ??; do sleep 20; ionice -c 3 find \$i -mmin +$maxagemin -type f -delete; done' /dev/null 2>&1 &"); } if (EDC('getcachelog')) -- cgit v1.2.3