X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FCron%2Frt_tasks.pm;h=21488762aa406895b7ed50459f9a79ea9e6d518c;hb=57bb423fe457ba4e13726877f53bcdf944f828f8;hp=4977eb2f8be8b6d6547895e0c93d76f44184fd49;hpb=c9eedc94b5294c9d0a69687272ca47328d15328b;p=freeside.git diff --git a/FS/FS/Cron/rt_tasks.pm b/FS/FS/Cron/rt_tasks.pm index 4977eb2f8..21488762a 100644 --- a/FS/FS/Cron/rt_tasks.pm +++ b/FS/FS/Cron/rt_tasks.pm @@ -29,11 +29,12 @@ sub rt_daily { # RT_External installations should have their own cron scripts for this my $system = $FS::TicketSystem::system; - return if $system ne 'RT_Internal'; + return if !defined($system) || $system ne 'RT_Internal'; + + system('/opt/rt3/sbin/rt-clean-sessions --older 1M --skip-user &'); + + system('/opt/rt3/sbin/rt-fulltext-indexer --quiet --limit 5400 &'); - $DEBUG = 1 if $opt{'v'}; - RT::Config->Set( LogToScreen => 'debug' ) if $DEBUG; - # if -d or -y is in use, bail out. There's no reliable way to tell RT # to use an alternate system time. if ( $opt{'d'} or $opt{'y'} ) { @@ -46,6 +47,9 @@ sub rt_daily { my $CurrentUser = $session->{'CurrentUser'} or die "Failed to create RT session"; + $DEBUG = 1 if $opt{'v'}; + RT::Config->Set( LogToScreen => 'debug' ) if $DEBUG; + # load some modules that aren't handled in FS::TicketSystem foreach (qw( Search::ActiveTicketsInQueue