aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Utils
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-04-25 17:23:48 +0200
committerRobin Appelman <icewind@owncloud.com>2016-04-25 17:23:48 +0200
commit61054df36d942c1a2c5fe7e739b7ad767c81c4c4 (patch)
tree802a1b6680359afb67fa0b853078bcd8cf6c15ab /lib/private/Files/Utils
parent632159613447796b5bb7dbe3a17c194573b18b4a (diff)
downloadnextcloud-server-61054df36d942c1a2c5fe7e739b7ad767c81c4c4.tar.gz
nextcloud-server-61054df36d942c1a2c5fe7e739b7ad767c81c4c4.zip
triger the propagator from the command line scanner
Diffstat (limited to 'lib/private/Files/Utils')
-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());
+ }
}