diff --git a/lib/WebGUI/Workflow/Activity/CleanTempStorage.pm b/lib/WebGUI/Workflow/Activity/CleanTempStorage.pm index 653467ac5..3e2b0ac49 100644 --- a/lib/WebGUI/Workflow/Activity/CleanTempStorage.pm +++ b/lib/WebGUI/Workflow/Activity/CleanTempStorage.pm @@ -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)) { diff --git a/lib/WebGUI/Workflow/Activity/ExpirePurchasedThingyRecords.pm b/lib/WebGUI/Workflow/Activity/ExpirePurchasedThingyRecords.pm index 27600d537..9a7479439 100644 --- a/lib/WebGUI/Workflow/Activity/ExpirePurchasedThingyRecords.pm +++ b/lib/WebGUI/Workflow/Activity/ExpirePurchasedThingyRecords.pm @@ -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); } } @@ -140,7 +140,7 @@ sub execute { $asset->deleteThingRecord( $asset->get('thingId'), $record->getId ); - if ( time - $time > 60 ) { + if ( time - $time > $self->getTTL ) { return $self->WAITING(1); } } diff --git a/lib/WebGUI/Workflow/Activity/ExtendCalendarRecurrences.pm b/lib/WebGUI/Workflow/Activity/ExtendCalendarRecurrences.pm index 5f85b184e..2b4ff6a94 100644 --- a/lib/WebGUI/Workflow/Activity/ExtendCalendarRecurrences.pm +++ b/lib/WebGUI/Workflow/Activity/ExtendCalendarRecurrences.pm @@ -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();