cron officially works!!!
This commit is contained in:
parent
18e8de5856
commit
524ea87d36
4 changed files with 146 additions and 51 deletions
|
|
@ -70,16 +70,23 @@ sub create {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 delete ( )
|
||||
=head2 delete ( [ skipNotify ] )
|
||||
|
||||
Removes this job from the schedule.
|
||||
|
||||
=head3 skipNotify
|
||||
|
||||
A boolean indicating whether to skip spectre notification of this event.
|
||||
|
||||
=cut
|
||||
|
||||
sub delete {
|
||||
my $self = shift;
|
||||
my $skipNotify = shift;
|
||||
$self->session->db->deleteRow("WorkflowSchedule","taskId",$self->getId);
|
||||
WebGUI::Workflow::Spectre->new($self->session)->notify("cron/deleteJob",$self->getId);
|
||||
if ($skipNotify) {
|
||||
WebGUI::Workflow::Spectre->new($self->session)->notify("cron/deleteJob",{taskId=>$self->getId, config=>$self->session->config->getFilename});
|
||||
}
|
||||
undef $self;
|
||||
}
|
||||
|
||||
|
|
@ -276,8 +283,11 @@ sub set {
|
|||
$self->{_data}{enabled} = 0 unless ($self->{_data}{workflowId});
|
||||
my $spectre = WebGUI::Workflow::Spectre->new($self->session);
|
||||
$self->session->db->setRow("WorkflowSchedule","taskId",$self->{_data});
|
||||
$spectre->notify("cron/deleteJob",$self->getId);
|
||||
$spectre->notify("cron/addJob",$self->session->config->getFilename, $self->{_data});
|
||||
$spectre->notify("cron/deleteJob",{taskId=>$self->getId,config=>$self->session->config->getFilename});
|
||||
my %params = %{$self->{_data}};
|
||||
$params{config} = $self->session->config->getFilename;
|
||||
$params{sitename} = $self->session->config->get("sitename")->[0];
|
||||
$spectre->notify("cron/addJob", \%params);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ sub create {
|
|||
return undef if ($isSerial && $count);
|
||||
my $instanceId = $session->db->setRow("WorkflowInstance","instanceId",{instanceId=>"new", runningSince=>time()}, $id);
|
||||
my $self = $class->new($session, $instanceId);
|
||||
$properties->{priority} ||= 2;
|
||||
$properties->{notifySpectre} = 1 unless ($properties->{notifySpectre} eq "0");
|
||||
$self->set($properties);
|
||||
return $self;
|
||||
}
|
||||
|
|
@ -306,7 +306,7 @@ sub set {
|
|||
$self->{_data}{currentActivityId} = (exists $properties->{currentActivityId}) ? $properties->{currentActivityId} : $self->{_data}{currentActivityId};
|
||||
$self->{_data}{lastUpdate} = time();
|
||||
$self->session->db->setRow("WorkflowInstance","instanceId",$self->{_data});
|
||||
if ($properties->{priority}) {
|
||||
if ($properties->{priority} && $properties->{notifySpectre}) {
|
||||
my $spectre = WebGUI::Workflow::Spectre->new($self->session);
|
||||
$spectre->notify("workflow/deleteInstance",$self->getId);
|
||||
$spectre->notify("workflow/addInstance", {sitename=>$self->session->config->get("sitename")->[0], instanceId=>$self->getId, priority=>$self->{_data}{priority}});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue