diff --git a/include/class.cron.php b/include/class.cron.php index af5a1476865f7cf11f40f1b39f195f11a1660f63..f231ac5b3db00695cfa0a0a1045ff62d0bec9745 100644 --- a/include/class.cron.php +++ b/include/class.cron.php @@ -98,7 +98,9 @@ class Cron { self::MailFetcher(); self::TicketMonitor(); self::PurgeLogs(); - self::CleanOrphanedFiles(); + // Run file purging about every 10 cron runs + if (mt_rand(1, 9) == 4) + self::CleanOrphanedFiles(); self::PurgeDrafts(); self::MaybeOptimizeTables(); diff --git a/scp/autocron.php b/scp/autocron.php index b6016399e0b4745c62891dd7cce4b3f77df6fcca..eabc67151374c7d28eaf4895efe409f21652e5d9 100644 --- a/scp/autocron.php +++ b/scp/autocron.php @@ -44,6 +44,11 @@ require_once(INCLUDE_DIR.'class.cron.php'); $thisstaff = null; //Clear staff obj to avoid false credit internal notes & auto-assignment Cron::TicketMonitor(); //Age tickets: We're going to age tickets regardless of cron settings. + +// Run file purging about every 30 minutes +if (mt_rand(1, 9) == 4) + Cron::CleanOrphanedFiles(); + if($cfg && $cfg->isAutoCronEnabled()) { //ONLY fetch tickets if autocron is enabled! Cron::MailFetcher(); //Fetch mail. $ost->logDebug(_S('Auto Cron'), sprintf(_S('Mail fetcher cron call [%s]'), $caller));