Skip to content

Commit

Permalink
fix: don't propagate future mtimes
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Nov 28, 2024
1 parent 6230849 commit d41983f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/private/Files/Cache/Propagator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
use OCP\Files\Cache\IPropagator;
use OCP\Files\Storage\IReliableEtagStorage;
use OCP\IDBConnection;
use OCP\Server;
use Psr\Clock\ClockInterface;
use Psr\Log\LoggerInterface;

/**
Expand All @@ -39,10 +41,13 @@ class Propagator implements IPropagator {
*/
private $ignore = [];

private ClockInterface $clock;

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

/**
Expand All @@ -58,6 +63,8 @@ public function propagateChange($internalPath, $time, $sizeDifference = 0) {
}
}

$time = min($time, $this->clock->now()->getTimestamp());

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

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

0 comments on commit d41983f

Please sign in to comment.