re-read job, in case it had been updated or even deleted in the method

This commit is contained in:
Ralf Becker 2004-07-12 23:46:54 +00:00
parent 008c95aa98
commit 04650e3680

View File

@ -435,14 +435,21 @@
$GLOBALS['phpgw']->translation->add_app($app); $GLOBALS['phpgw']->translation->add_app($app);
ExecMethod($job['method'],$job['data']); ExecMethod($job['method'],$job['data']);
if ($job['next'] = $this->next_run($job['times'])) // re-read job, in case it had been updated or even deleted in the method
$updated = $this->read($id);
if ($updated && isset($updated[$id]))
{ {
$this->write($job,True); $job = $updated[$id];
}
else // no further runs if ($job['next'] = $this->next_run($job['times']))
{ {
$this->delete($job['id']); $this->write($job,True);
}
else // no further runs
{
$this->delete($job['id']);
}
} }
} }
} }