mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 09:09:04 +01:00
* Async service/Backup: updating job to next scheduled time BEFORE running it, to copy with jobs running longer then async frequency of 5min, eg. backup
This commit is contained in:
parent
59c683c359
commit
8e85c86f8b
@ -433,6 +433,15 @@ class asyncservice
|
|||||||
{
|
{
|
||||||
$job['data'] += array_diff_key($job,array('data' => false));
|
$job['data'] += array_diff_key($job,array('data' => false));
|
||||||
}
|
}
|
||||||
|
// update job before running it, to cope with jobs taking longer then async-frequency
|
||||||
|
if (($job['next'] = $this->next_run($job['times'])))
|
||||||
|
{
|
||||||
|
$this->write($job, True);
|
||||||
|
}
|
||||||
|
else // no further runs
|
||||||
|
{
|
||||||
|
$this->delete($job['id']);
|
||||||
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ExecMethod($job['method'],$job['data']);
|
ExecMethod($job['method'],$job['data']);
|
||||||
@ -442,21 +451,6 @@ class asyncservice
|
|||||||
// log the exception to error_log, but continue running other async jobs
|
// log the exception to error_log, but continue running other async jobs
|
||||||
_egw_log_exception($e);
|
_egw_log_exception($e);
|
||||||
}
|
}
|
||||||
// re-read job, in case it had been updated or even deleted in the method
|
|
||||||
$updated = $this->read($id);
|
|
||||||
if ($updated && isset($updated[$id]))
|
|
||||||
{
|
|
||||||
$job = $updated[$id];
|
|
||||||
|
|
||||||
if ($job['next'] = $this->next_run($job['times']))
|
|
||||||
{
|
|
||||||
$this->write($job,True);
|
|
||||||
}
|
|
||||||
else // no further runs
|
|
||||||
{
|
|
||||||
$this->delete($job['id']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->last_check_run(True,True,$run_by); // release semaphore
|
$this->last_check_run(True,True,$run_by); // release semaphore
|
||||||
|
Loading…
Reference in New Issue
Block a user