Browse Source

Merge pull request #22998 from owncloud/delay-loading-the-scanner

Delay check till scanner is used
remotes/origin/external-storage-mountpoint-root
Thomas Müller 10 years ago
parent
commit
d4a8d5d2ea
  1. 5
      apps/files_sharing/lib/external/scanner.php
  2. 5
      apps/files_sharing/lib/external/storage.php

5
apps/files_sharing/lib/external/scanner.php

@ -36,6 +36,10 @@ class Scanner extends \OC\Files\Cache\Scanner {
/** {@inheritDoc} */ /** {@inheritDoc} */
public function scan($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $lock = true) { public function scan($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $lock = true) {
if(!$this->storage->remoteIsOwnCloud()) {
return parent::scan($path, $recursive, $recursive, $lock);
}
$this->scanAll(); $this->scanAll();
} }
@ -90,7 +94,6 @@ class Scanner extends \OC\Files\Cache\Scanner {
} }
if ($data['status'] === 'success') { if ($data['status'] === 'success') {
$this->addResult($data['data'], ''); $this->addResult($data['data'], '');
} elseif ($data['status'] === 'unsupported') {
} else { } else {
throw new \Exception( throw new \Exception(
'Error while scanning remote share: "' . 'Error while scanning remote share: "' .

5
apps/files_sharing/lib/external/storage.php

@ -136,9 +136,6 @@ class Storage extends DAV implements ISharedStorage {
if (!$storage) { if (!$storage) {
$storage = $this; $storage = $this;
} }
if(!$this->remoteIsOwnCloud()) {
return parent::getScanner($path, $storage);
}
if (!isset($this->scanner)) { if (!isset($this->scanner)) {
$this->scanner = new Scanner($storage); $this->scanner = new Scanner($storage);
} }
@ -266,7 +263,7 @@ class Storage extends DAV implements ISharedStorage {
* *
* @return bool * @return bool
*/ */
private function remoteIsOwnCloud() {
public function remoteIsOwnCloud() {
if(defined('PHPUNIT_RUN') || !$this->testRemoteUrl($this->getRemote() . '/status.php')) { if(defined('PHPUNIT_RUN') || !$this->testRemoteUrl($this->getRemote() . '/status.php')) {
return false; return false;
} }

Loading…
Cancel
Save