Make the change propagator an emitter
This commit is contained in:
parent
2dc11cf20e
commit
849e5521de
|
@ -22,12 +22,14 @@
|
|||
|
||||
namespace OC\Files\Cache;
|
||||
|
||||
use OC\Hooks\BasicEmitter;
|
||||
|
||||
/**
|
||||
* Propagates changes in etag and mtime up the filesystem tree
|
||||
*
|
||||
* @package OC\Files\Cache
|
||||
*/
|
||||
class ChangePropagator {
|
||||
class ChangePropagator extends BasicEmitter {
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
|
@ -75,6 +77,7 @@ class ChangePropagator {
|
|||
$cache = $storage->getCache();
|
||||
$entry = $cache->get($internalPath);
|
||||
$cache->update($entry['fileid'], array('mtime' => max($time, $entry['mtime']), 'etag' => $storage->getETag($internalPath)));
|
||||
$this->emit('\OC\Files', 'propagate', [$parent, $entry]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,6 +60,10 @@ class Updater {
|
|||
$this->enabled = true;
|
||||
}
|
||||
|
||||
public function getPropagator() {
|
||||
return $this->propagator;
|
||||
}
|
||||
|
||||
public function propagate($path, $time = null) {
|
||||
if (Scanner::isPartialFile($path)) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue