Merge pull request #21289 from owncloud/issue-20399-keep-periodic-background-jobs
Do not delete background jobs, in case an exception occured
This commit is contained in:
commit
0b913f00c7
|
@ -54,7 +54,6 @@ abstract class Job implements IJob {
|
|||
if ($logger) {
|
||||
$logger->error('Error while running background job: ' . $e->getMessage());
|
||||
}
|
||||
$jobList->remove($this, $this->argument);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,10 +23,17 @@ class Job extends \Test\TestCase {
|
|||
});
|
||||
$jobList->add($job);
|
||||
|
||||
$logger = $this->getMockBuilder('OCP\ILogger')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$logger->expects($this->once())
|
||||
->method('error')
|
||||
->with('Error while running background job: ');
|
||||
|
||||
$this->assertCount(1, $jobList->getAll());
|
||||
$job->execute($jobList);
|
||||
$job->execute($jobList, $logger);
|
||||
$this->assertTrue($this->run);
|
||||
$this->assertCount(0, $jobList->getAll());
|
||||
$this->assertCount(1, $jobList->getAll());
|
||||
}
|
||||
|
||||
public function markRun() {
|
||||
|
|
Loading…
Reference in New Issue