From 97c02e6168613c03dd0166331832a41a4142ff61 Mon Sep 17 00:00:00 2001
From: Urban Müller
Date: Wed, 27 Jan 2016 18:19:09 +0100
Subject: throttle cache cleanup

---
 it_url.class | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/it_url.class b/it_url.class
index 6f804e2..d27a809 100644
--- a/it_url.class
+++ b/it_url.class
@@ -649,7 +649,7 @@ function get_cache($p = array())
 	{
 		touch($p['cachedir'] . "/cleaned");
 		$maxagemin = intval($p['maxage']/60);
-		exec("nohup bash -c 'cd {$p['cachedir']} && sleep 10 && find ?? -mmin +$maxagemin -print0 | xargs -0 -r rm' </dev/null >/dev/null 2>&1 &");
+		exec("nohup bash -c 'cd {$p['cachedir']} && for i in ??; do sleep 2; find \$i -mmin +$maxagemin | xargs -r rm; done' </dev/null >/dev/null 2>&1 &");
 	}
 
 	if (EDC('getcachelog'))
-- 
cgit v1.2.3