Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
ENH: fixed bug #158 Added run_only_once support
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Ma committed Jun 22, 2011
1 parent 1cfcd98 commit 9f82a6b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion modules/scheduler/controllers/RunController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ function indexAction()
foreach($jobs as $job)
{
$job->setStatus(SCHEDULER_JOB_STATUS_STARTED);
if($job->getRunOnlyOnce() == 0)
{
$firetime = strtotime($job->getFireTime()) + $job->getTimeInterval();
$job->setFireTime(date('c', $firetime));
}
$job->setTimeLastFired(date('c'));
$this->Scheduler_Job->save($job);
try
Expand All @@ -54,7 +59,14 @@ function indexAction()
$this->Scheduler_Job->save($job);
continue;
}
$job->setStatus(SCHEDULER_JOB_STATUS_DONE);
if($job->getRunOnlyOnce() == 0)
{
$job->setStatus(SCHEDULER_JOB_STATUS_TORUN);
}
else
{
$job->setStatus(SCHEDULER_JOB_STATUS_DONE);
}
$this->Scheduler_Job->save($job);
}
}
Expand Down

0 comments on commit 9f82a6b

Please sign in to comment.