Merge commit '4635b91554' into WebGUI8. Syntax clean up to 7.10.2

This commit is contained in:
Colin Kuskie 2010-10-27 15:59:33 -07:00
commit 87326192a3
46 changed files with 956 additions and 969 deletions

View file

@ -102,8 +102,9 @@ See WebGUI::Workflow::Activity::execute() for details.
=cut
sub execute {
my $self = shift;
my $self = shift;
my $start = time();
my $stop = $start + $self->getTTL;
# kill temporary assets
my $tempspace = WebGUI::Asset->getTempspace($self->session);
@ -125,11 +126,11 @@ sub execute {
}
}
# taking too long, give up
return $self->WAITING(1) if (time() - $start > $self->getTTL);
return $self->WAITING(1) if (time() > $stop);
}
# kill temporary files
return $self->recurseFileSystem($start, $self->session->config->get("uploadsPath")."/temp");
return $self->recurseFileSystem($stop, $self->session->config->get("uploadsPath")."/temp");
}
@ -147,7 +148,7 @@ The starting path.
sub recurseFileSystem {
my $self = shift;
my $start = shift;
my $stop = shift;
my $path = shift;
if (opendir(DIR,$path)) {
my @filelist = readdir(DIR);
@ -155,10 +156,10 @@ sub recurseFileSystem {
foreach my $file (@filelist) {
unless ($file eq "." || $file eq "..") {
# taking too long, time to abort
return $self->WAITING(1) if (time() - $start > 50);
return $self->WAITING(1) if (time() > $stop);
# must search for children
$self->recurseFileSystem($start, $path."/".$file);
$self->recurseFileSystem($stop, $path."/".$file);
# if it's old enough, let's kill it
if ($self->checkFileAge($path."/".$file)) {

View file

@ -111,7 +111,7 @@ sub execute {
$msg->addHtml( $self->get('notificationMessage') );
$msg->queue;
if ( time - $time > 60 ) {
if ( time - $time > $self->getTTL ) {
return $self->WAITING(1);
}
}

View file

@ -65,7 +65,7 @@ See WebGUI::Workflow::Activity::execute() for details.
sub execute {
my ( $self, $obj, $instance ) = @_;
my $timeLimit = time + 55;
my $timeLimit = time + $self->getTTL;
my $piped = $instance->getScratch('recurrences')
|| $self->generateRecurrenceList();