implemented run once cron jobs
This commit is contained in:
parent
d7e2264153
commit
3a174e4eb5
1 changed files with 5 additions and 1 deletions
|
|
@ -115,13 +115,17 @@ sub checkSchedule {
|
|||
my $cron = DateTime::Cron::Simple->new($job->{schedule});
|
||||
if ($cron->validate_time($now)) {
|
||||
my $session = WebGUI::Session->open($self->{_config}->getWebguiRoot, $job->{config});
|
||||
my $instance = WebGUI::Workflow::Instance->create($session, {
|
||||
WebGUI::Workflow::Instance->create($session, {
|
||||
workflowId=>$job->{workflowId},
|
||||
className=>$job->{className},
|
||||
methodName=>$job->{methodName},
|
||||
parameters=>$job->{parameters},
|
||||
priority=>$job->{priority}
|
||||
});
|
||||
if ($job->{runOnce}) {
|
||||
my $cron = WebGUI::Workflow::Cron->new($session, $job->{jobId});
|
||||
$cron->delete if defined $cron;
|
||||
}
|
||||
$session->close;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue