Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Modify backported repair step for 9.1
  • Loading branch information
tomneedham authored and Vincent Petry committed Nov 7, 2017
commit e81442e20de65419d36177893fb170beabf24eac
2 changes: 1 addition & 1 deletion apps/files/lib/Command/Scan.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ protected function scanFiles($user, $path, $verbose, OutputInterface $output, $b
try {
// FIXME: this will lock the storage even if there is nothing to repair
$storage->acquireLock('', ILockingProvider::LOCK_EXCLUSIVE, $this->lockingProvider);
} catch (OCP\Lock\LockedException $e) {
} catch (LockedException $e) {
$output->writeln("\t<error>Storage \"" . $storage->getCache()->getNumericStorageId() . '" cannot be repaired as it is currently in use, please try again later</error>');
return;
}
Expand Down
12 changes: 6 additions & 6 deletions tests/lib/Repair/RepairMismatchFileCachePathTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function setUp() {

$this->connection = \OC::$server->getDatabaseConnection();

$mimeLoader = $this->createMock(IMimeTypeLoader::class);
$mimeLoader = $this->getMockBuilder(IMimeTypeLoader::class)->getMock();
$mimeLoader->method('getId')
->will($this->returnValueMap([
['httpd', 1],
Expand Down Expand Up @@ -205,7 +205,7 @@ public function testRepairEntry($sourceStorageId, $targetStorageId, $targetDir,

$doNotTouchId = $this->createFileCacheEntry($sourceStorageId, 'files/source/do_not_touch', $sourceId);

$outputMock = $this->createMock(IOutput::class);
$outputMock = $this->getMockBuilder(IOutput::class)->getMock();
if (is_null($repairStoragesOrder)) {
// no storage selected, full repair
$this->repair->setStorageNumericId(null);
Expand Down Expand Up @@ -345,7 +345,7 @@ public function testRepairSelfReferencing() {
// End parallel storage


$outputMock = $this->createMock(IOutput::class);
$outputMock = $this->getMockBuilder(IOutput::class)->getMock();
$this->repair->setStorageNumericId($storageId);
$this->repair->run($outputMock);

Expand Down Expand Up @@ -535,7 +535,7 @@ public function testRepairParentIdPointingNowhere() {
$wrongParentRootId = $this->createFileCacheEntry($storageId, 'wrongparentroot', $nonExistingParentId);
$wrongParentId = $this->createFileCacheEntry($storageId, 'files/wrongparent', $nonExistingParentId);

$outputMock = $this->createMock(IOutput::class);
$outputMock = $this->getMockBuilder(IOutput::class)->getMock();
$this->repair->setStorageNumericId($storageId);
$this->repair->run($outputMock);

Expand Down Expand Up @@ -593,7 +593,7 @@ public function testRepairDetachedSubtree() {
$notOrphanedId2_parallel = $this->createFileCacheEntry($storageId_parallel, 'missingdir/missingdir1/orphaned2', $notOrphanedFolder2_parallel);
// end parallel test storage

$outputMock = $this->createMock(IOutput::class);
$outputMock = $this->getMockBuilder(IOutput::class)->getMock();
$this->repair->setStorageNumericId($storageId);
$this->repair->run($outputMock);

Expand Down Expand Up @@ -700,7 +700,7 @@ public function testRepairMissingRoot() {
$noRootid = $this->createFileCacheEntry($testStorageId, 'noroot', $baseId);


$outputMock = $this->createMock(IOutput::class);
$outputMock = $this->getMockBuilder(IOutput::class)->getMock();
$this->repair->setStorageNumericId($storageId);
$this->repair->run($outputMock);

Expand Down