Fixed workflow checks on spectre so that workflows only error if they are a non realtime or failed realtime and spectre is down.

This commit is contained in:
Kaleb Murphy 2008-10-21 21:02:57 +00:00
parent 20460192a6
commit 7e368c329c
3 changed files with 10 additions and 12 deletions

View file

@ -307,13 +307,6 @@ sub www_commitVersionTag {
my $session = shift;
my $tagId = $session->form->param("tagId");
my $spectreTest = WebGUI::Operation::Spectre::spectreTest($session);
if($spectreTest ne "success"){
my $i18n = WebGUI::International->new($session, "Macro_SpectreCheck")->get($spectreTest);
my $ac = WebGUI::AdminConsole->new($session,"versions");
return $ac->render( $i18n );
}
if ( !$tagId ) {
return www_manageVersions( $session );
}

View file

@ -408,8 +408,6 @@ fails.
sub requestCommit {
my $self = shift;
return "Failure" if(WebGUI::Operation::Spectre::spectreTest($self->session) ne "success");
$self->lock;
my $instance = WebGUI::Workflow::Instance->create($self->session, {
workflowId=>$self->get("workflowId"),
@ -420,7 +418,7 @@ sub requestCommit {
$self->{_data}{committedBy} = $self->session->user->userId;
$self->{_data}{workflowInstanceId} = $instance->getId;
$self->session->db->setRow("assetVersionTag","tagId",$self->{_data});
$instance->start;
return $instance->start;
return undef;
}

View file

@ -20,8 +20,8 @@ use JSON;
use WebGUI::Pluggable;
use WebGUI::Workflow::Spectre;
use WebGUI::Workflow;
use WebGUI::International;
use WebGUI::Operation::Spectre;
=head1 NAME
Package WebGUI::Workflow::Instance
@ -527,6 +527,13 @@ sub start {
$log->info('Could not complete workflow instance '.$self->getId.' in realtime, handing off to Spectre.');
my $spectre = WebGUI::Workflow::Spectre->new($self->session);
$spectre->notify("workflow/addInstance", {cookieName=>$self->session->config->getCookieName, gateway=>$self->session->config->get("gateway"), sitename=>$self->session->config->get("sitename")->[0], instanceId=>$self->getId, priority=>$self->{_data}{priority}});
my $spectreTest = WebGUI::Operation::Spectre::spectreTest($self->session);
if($spectreTest ne "success"){
return WebGUI::International->new($self->session, "Macro_SpectreCheck")->get($spectreTest);
}
return undef;
}
1;