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:
Thomas Müller 2015-12-21 09:47:07 +01:00
commit 0b913f00c7
2 changed files with 9 additions and 3 deletions

View File

@ -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);
}
}

View File

@ -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() {