- Fixed a memory leak in Spectre that could cause it to double in size

roughly every 30 hours under certain conditions.
This commit is contained in:
JT Smith 2006-06-20 14:07:59 +00:00
parent 485393f453
commit 4f91b4bf4e
3 changed files with 9 additions and 5 deletions

View file

@ -2,6 +2,8 @@
- fix: Add a Related Product not working
- fix: Edit button missing in timetracker projects
- fix: Upgrade from 6.8.10 to 6.99.4 failed
- Fixed a memory leak in Spectre that could cause it to double in size
roughly every 30 hours under certain conditions.
6.99.4

View file

@ -256,6 +256,7 @@ The config file name for the site this job belongs to.
sub deleteJob {
my ($self, $params) = @_[OBJECT, ARG0];
$self->debug("Deleting schedule ".$params->{taskId}." for ".$params->{config}." from queue.");
delete $self->{_errorCount}{$params->{config}}{$params->{taskId}};
delete $self->{_jobs}{$params->{config}}{$params->{taskId}};
}
@ -418,7 +419,7 @@ sub runJobResponse {
}
my $state = $response->content;
if ($state eq "done") {
$self->{_errorCount}{$config}{$taskId} = 0;
delete $self->{_errorCount}{$config}{$taskId};
$self->debug("Scheduled task $config / $taskId is now complete.");
if ($job->{runOnce}) {
$kernel->yield("deleteJob",{config=>$job->{config}, taskId=>$job->{taskId}});

View file

@ -18,6 +18,7 @@ use strict;
use HTTP::Request::Common;
use POE;
use POE::Component::Client::UserAgent;
use WebGUI::Session;
#-------------------------------------------------------------------
@ -189,6 +190,7 @@ sub deleteInstance {
$self->debug("Deleting workflow instance $instanceId from instance queue.");
if ($self->{_instances}{$instanceId}) {
my $priority = $self->{_instances}{$instanceId}{priority};
delete $self->{_errorCount}{$instanceId};
delete $self->{_instances}{$instanceId};
for (my $i=0; $i < scalar(@{$self->{"_priority".$priority}}); $i++) {
if ($self->{"_priority".$priority}[$i] eq $instanceId) {
@ -398,19 +400,18 @@ sub workerResponse {
}
my $state = $response->content;
if ($state eq "waiting") {
$self->{_errorCount}{$instanceId}=0;
delete $self->{_errorCount}{$instanceId};
$self->debug("Was told to wait on $instanceId because we're still waiting on some external event.");
$kernel->yield("suspendInstance",$instanceId);
} elsif ($state eq "complete") {
$self->{_errorCount}{$instanceId}=0;
delete $self->{_errorCount}{$instanceId};
$self->debug("Workflow instance $instanceId ran one of it's activities successfully.");
$kernel->yield("returnInstanceToQueue",$instanceId);
} elsif ($state eq "disabled") {
$self->{_errorCount}{$instanceId}=0;
delete $self->{_errorCount}{$instanceId};
$self->debug("Workflow instance $instanceId is disabled.");
$kernel->yield("suspendInstance",$instanceId);
} elsif ($state eq "done") {
$self->{_errorCount}{$instanceId}=0;
$self->debug("Workflow instance $instanceId is now complete.");
$kernel->yield("deleteInstance",$instanceId);
} elsif ($state eq "error") {