diff options
author | Robin Appelman <icewind@owncloud.com> | 2016-04-25 17:23:48 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-04-25 17:23:48 +0200 |
commit | 61054df36d942c1a2c5fe7e739b7ad767c81c4c4 (patch) | |
tree | 802a1b6680359afb67fa0b853078bcd8cf6c15ab /lib/private/Files | |
parent | 632159613447796b5bb7dbe3a17c194573b18b4a (diff) | |
download | nextcloud-server-61054df36d942c1a2c5fe7e739b7ad767c81c4c4.tar.gz nextcloud-server-61054df36d942c1a2c5fe7e739b7ad767c81c4c4.zip |
triger the propagator from the command line scanner
Diffstat (limited to 'lib/private/Files')
-rw-r--r-- | lib/private/Files/Utils/Scanner.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php index 06526583899..b013cbecabc 100644 --- a/lib/private/Files/Utils/Scanner.php +++ b/lib/private/Files/Utils/Scanner.php @@ -29,6 +29,7 @@ use OC\Files\Filesystem; use OC\ForbiddenException; use OC\Hooks\PublicEmitter; use OC\Lock\DBLockingProvider; +use OCP\Files\Storage\IStorage; use OCP\Files\StorageNotAvailableException; use OCP\ILogger; @@ -153,6 +154,17 @@ class Scanner extends PublicEmitter { $scanner->setUseTransactions(false); $this->attachListener($mount); $isDbLocking = \OC::$server->getLockingProvider() instanceof DBLockingProvider; + + $scanner->listen('\OC\Files\Cache\Scanner', 'removeFromCache', function ($path) use ($storage) { + $this->triggerPropagator($storage, $path); + }); + $scanner->listen('\OC\Files\Cache\Scanner', 'updateCache', function ($path) use ($storage) { + $this->triggerPropagator($storage, $path); + }); + $scanner->listen('\OC\Files\Cache\Scanner', 'addToCache', function ($path) use ($storage) { + $this->triggerPropagator($storage, $path); + }); + if (!$isDbLocking) { $this->db->beginTransaction(); } @@ -168,5 +180,9 @@ class Scanner extends PublicEmitter { } } } + + private function triggerPropagator(IStorage $storage, $internalPath) { + $storage->getPropagator()->propagateChange($internalPath, time()); + } } |