- fix create.sql / style3
- fix Spectre memory consumption - fix password vidible in debug mode - fix No way to add an advertisment to an adspace.
This commit is contained in:
parent
58331a5834
commit
741b523ad3
6 changed files with 48 additions and 18 deletions
|
|
@ -99,7 +99,7 @@ Prints out error information.
|
|||
sub error {
|
||||
my $self = shift;
|
||||
my $output = shift;
|
||||
print "ADMIN: ".$output."\n";
|
||||
print "ADMIN: [Error] ".$output."\n";
|
||||
$self->getLogger->error("ADMIN: ".$output);
|
||||
}
|
||||
|
||||
|
|
@ -183,6 +183,7 @@ sub runTests {
|
|||
$self->debug("Running connectivity tests.");
|
||||
my $configs = WebGUI::Config->readAllConfigs($self->config->getWebguiRoot);
|
||||
foreach my $config (keys %{$configs}) {
|
||||
next if $config =~ m/^demo/;
|
||||
$self->debug("Testing $config");
|
||||
my $userAgent = new LWP::UserAgent;
|
||||
$userAgent->agent("Spectre");
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ sub _start {
|
|||
$self->debug("Loading the schedules from all the sites.");
|
||||
my $configs = WebGUI::Config->readAllConfigs($self->config->getWebguiRoot);
|
||||
foreach my $config (keys %{$configs}) {
|
||||
next if $config =~ m/^demo/;
|
||||
$kernel->yield("loadSchedule", $config);
|
||||
}
|
||||
$kernel->yield("checkSchedules");
|
||||
|
|
@ -273,7 +274,7 @@ sub error {
|
|||
my $self = shift;
|
||||
my $output = shift;
|
||||
if ($self->{_debug}) {
|
||||
print "CRON: ".$output."\n";
|
||||
print "CRON: [Error] ".$output."\n";
|
||||
}
|
||||
$self->getLogger->error("CRON: ".$output);
|
||||
}
|
||||
|
|
@ -372,8 +373,11 @@ sub runJob {
|
|||
$self->debug("Preparing to run a scheduled job ".$job->{taskId}.".");
|
||||
POE::Component::Client::UserAgent->new;
|
||||
if ($job->{sitename} eq "" || $job->{config} eq "" || $job->{taskId} eq "") {
|
||||
$self->error("Warning: A scheduled task has corrupt information and is not able to be run. Skipping execution.");
|
||||
$self->error("A scheduled task has corrupt information and is not able to be run. Skipping execution.");
|
||||
$kernel->yield("deleteJob",{config=>$job->{config}, taskId=>$job->{taskId}}) if ($job->{config} ne "" && $job->{taskId} ne "");
|
||||
} elsif ($self->{_errorCount}{$job->{config}}{$job->{taskId}} >= 5) {
|
||||
$self->error("Scheduled task ".$job->{config}." / ".$job->{taskId}." has failed ".$self->{_errorCount}{$job->{config}}{$job->{taskId}}." times in a row and will no longer attempt to execute.");
|
||||
$kernel->yield("deleteJob",{config=>$job->{config}, taskId=>$job->{taskId}});
|
||||
} else {
|
||||
my $url = "http://".$job->{sitename}.':'.$self->config->get("webguiPort").$job->{gateway};
|
||||
my $request = POST $url, [op=>"runCronJob", taskId=>$job->{taskId}];
|
||||
|
|
@ -414,23 +418,26 @@ sub runJobResponse {
|
|||
}
|
||||
my $state = $response->content;
|
||||
if ($state eq "done") {
|
||||
$self->{_errorCount}{$config}{$taskId} = 0;
|
||||
$self->debug("Scheduled task $config / $taskId is now complete.");
|
||||
if ($job->{runOnce}) {
|
||||
$kernel->yield("deleteJob",{config=>$job->{config}, taskId=>$job->{taskId}});
|
||||
}
|
||||
} elsif ($state eq "error") {
|
||||
$self->{_errorCount}{$config}{$taskId}++;
|
||||
$self->debug("Got an error response for scheduled task $config / $taskId, will try again in ".$self->config->get("suspensionDelay")." seconds.");
|
||||
$kernel->delay_set("runJob",$self->config->get("suspensionDelay"),$job);
|
||||
} else {
|
||||
$self->{_errorCount}{$config}{$taskId}++;
|
||||
$self->error("Something bad happened on the return of scheduled task $config / $taskId, will try again in ".$self->config->get("suspensionDelay")." seconds. ".$response->error_as_HTML);
|
||||
$kernel->delay_set("runJob",$self->config->get("suspensionDelay"),$job);
|
||||
}
|
||||
} elsif ($response->is_redirect) {
|
||||
$self->debug("Response for $config / $taskId was redirected.");
|
||||
$self->error("Response for $config / $taskId was redirected. This should never happen if configured properly!!!");
|
||||
} elsif ($response->is_error) {
|
||||
$self->error("Response for scheduled task $config / $taskId had a communications error. ".$response->error_as_HTML);
|
||||
$self->{_errorCount}{$config}{$taskId}++;
|
||||
$kernel->delay_set("runJob",$self->config->get("suspensionDelay"),$job);
|
||||
# we should probably log something
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ sub _start {
|
|||
$self->debug("Reading workflow configs.");
|
||||
my $configs = WebGUI::Config->readAllConfigs($self->config->getWebguiRoot);
|
||||
foreach my $config (keys %{$configs}) {
|
||||
next if $config =~ m/^demo/;
|
||||
$kernel->yield("loadWorkflows", $configs->{$config});
|
||||
}
|
||||
$kernel->yield("checkInstances");
|
||||
|
|
@ -211,7 +212,7 @@ sub error {
|
|||
my $self = shift;
|
||||
my $output = shift;
|
||||
if ($self->{_debug}) {
|
||||
print "WORKFLOW: ".$output."\n";
|
||||
print "WORKFLOW: [Error] ".$output."\n";
|
||||
}
|
||||
$self->getLogger->error("WORKFLOW: ".$output);
|
||||
}
|
||||
|
|
@ -355,17 +356,22 @@ Suspends a workflow instance for a number of seconds defined in the config file,
|
|||
|
||||
sub suspendInstance {
|
||||
my ($self, $instanceId, $kernel) = @_[OBJECT, ARG0, KERNEL];
|
||||
$self->debug("Suspending workflow instance ".$instanceId." for ".$self->config->get("suspensionDelay")." seconds.");
|
||||
# normally this is taken care of by the returnInstanceToQueue method, but we want to free up the running count
|
||||
# so that other things can be run while this thing is suspended
|
||||
if ($self->{_instances}{$instanceId}) {
|
||||
for (my $i=0; $i < scalar(@{$self->{_runningInstances}}); $i++) {
|
||||
if ($self->{_runningInstances}[$i] eq $instanceId) {
|
||||
splice(@{$self->{_runningInstances}}, $i, 1);
|
||||
if ($self->{_errorCount}{$instanceId} >= 5) {
|
||||
$self->error("Workflow instance $instanceId has failed to execute ".$self->{_errorCount}{$instanceId}." times in a row and will no longer attempt to execute.");
|
||||
$kernel->yield("deleteInstance",$instanceId);
|
||||
} else {
|
||||
$self->debug("Suspending workflow instance ".$instanceId." for ".$self->config->get("suspensionDelay")." seconds.");
|
||||
# normally this is taken care of by the returnInstanceToQueue method, but we want to free up the running count
|
||||
# so that other things can be run while this thing is suspended
|
||||
if ($self->{_instances}{$instanceId}) {
|
||||
for (my $i=0; $i < scalar(@{$self->{_runningInstances}}); $i++) {
|
||||
if ($self->{_runningInstances}[$i] eq $instanceId) {
|
||||
splice(@{$self->{_runningInstances}}, $i, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
$kernel->delay_set("returnInstanceToQueue",$self->config->get("suspensionDelay"), $instanceId);
|
||||
}
|
||||
$kernel->delay_set("returnInstanceToQueue",$self->config->get("suspensionDelay"), $instanceId);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -392,30 +398,36 @@ sub workerResponse {
|
|||
}
|
||||
my $state = $response->content;
|
||||
if ($state eq "waiting") {
|
||||
$self->{_errorCount}{$instanceId}=0;
|
||||
$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;
|
||||
$self->debug("Workflow instance $instanceId ran one of it's activities successfully.");
|
||||
$kernel->yield("returnInstanceToQueue",$instanceId);
|
||||
} elsif ($state eq "disabled") {
|
||||
$self->{_errorCount}{$instanceId}=0;
|
||||
$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") {
|
||||
$self->{_errorCount}{$instanceId}++;
|
||||
$self->debug("Got an error response for $instanceId.");
|
||||
$kernel->yield("suspendInstance",$instanceId);
|
||||
} else {
|
||||
$self->{_errorCount}{$instanceId}++;
|
||||
$self->error("Something bad happened on the return of $instanceId. ".$response->error_as_HTML);
|
||||
$kernel->yield("suspendInstance",$instanceId);
|
||||
}
|
||||
} elsif ($response->is_redirect) {
|
||||
$self->debug("Response for $instanceId was redirected.");
|
||||
$self->error("Response for $instanceId was redirected. This should never happen if configured properly!!!");
|
||||
} elsif ($response->is_error) {
|
||||
$self->{_errorCount}{$instanceId}++;
|
||||
$self->error("Response for $instanceId had a communications error. ".$response->error_as_HTML);
|
||||
$kernel->yield("suspendInstance",$instanceId)
|
||||
# we should probably log something
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue