Browse Source

No need to propogate changes in appdata

Right now we propogate a lof of changes in appdata. So for example we
propogate each and every preview that is added to the system. This has
no real added value as far as I can tell.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
tags/v16.0.0alpha1
Roeland Jago Douma 5 years ago
parent
commit
72f3882d4b
No account linked to committer's email address
2 changed files with 14 additions and 4 deletions
  1. 12
    3
      lib/private/Files/Cache/Propagator.php
  2. 2
    1
      lib/private/Files/Storage/Common.php

+ 12
- 3
lib/private/Files/Cache/Propagator.php View File

@@ -46,12 +46,14 @@ class Propagator implements IPropagator {
private $connection;

/**
* @param \OC\Files\Storage\Storage $storage
* @param IDBConnection $connection
* @var array
*/
public function __construct(\OC\Files\Storage\Storage $storage, IDBConnection $connection) {
private $ignore = [];

public function __construct(\OC\Files\Storage\Storage $storage, IDBConnection $connection, array $ignore = []) {
$this->storage = $storage;
$this->connection = $connection;
$this->ignore = $ignore;
}


@@ -62,6 +64,13 @@ class Propagator implements IPropagator {
* @suppress SqlInjectionChecker
*/
public function propagateChange($internalPath, $time, $sizeDifference = 0) {
// Do not propogate changes in ignored paths
foreach ($this->ignore as $ignore) {
if (strpos($internalPath, $ignore) === 0) {
return;
}
}

$storageId = (int)$this->storage->getStorageCache()->getNumericId();

$parents = $this->getParents($internalPath);

+ 2
- 1
lib/private/Files/Storage/Common.php View File

@@ -368,7 +368,8 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
$storage = $this;
}
if (!isset($storage->propagator)) {
$storage->propagator = new Propagator($storage, \OC::$server->getDatabaseConnection());
$config = \OC::$server->getSystemConfig();
$storage->propagator = new Propagator($storage, \OC::$server->getDatabaseConnection(), ['appdata_' . $config->getValue('instanceid')]);
}
return $storage->propagator;
}

Loading…
Cancel
Save