summaryrefslogtreecommitdiffstats
path: root/lib/private/Files
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-04-26 10:05:39 +0200
committerMorris Jobke <hey@morrisjobke.de>2016-04-26 10:05:39 +0200
commit23e7ad7a789b90091ab66f1b99091a1a515feb6b (patch)
tree0c0679deef9252011c7d6fe213a38722619b550c /lib/private/Files
parentef8fc6a03c2a72523bdb296c0cbcbf562872ba2e (diff)
parent61054df36d942c1a2c5fe7e739b7ad767c81c4c4 (diff)
downloadnextcloud-server-23e7ad7a789b90091ab66f1b99091a1a515feb6b.tar.gz
nextcloud-server-23e7ad7a789b90091ab66f1b99091a1a515feb6b.zip
Merge pull request #24256 from owncloud/scanner-propagate
triger the propagator from the command line scanner
Diffstat (limited to 'lib/private/Files')
-rw-r--r--lib/private/Files/Utils/Scanner.php16
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());
+ }
}