diff options
author | Robin Appelman <robin@icewind.nl> | 2023-09-21 18:33:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-21 18:33:15 +0200 |
commit | b11ca34bbd0c2d5fdbb6b68b3e1bf93dad02f588 (patch) | |
tree | f8c1a10506f2ac88c01a55523f155fa4e643b432 /apps/files_external | |
parent | 472440b296f405a159fc3363bd0ea250fda4f972 (diff) | |
parent | ccf8843d9fcf7d57c3c90da2d46913ca88b0ba70 (diff) | |
download | nextcloud-server-b11ca34bbd0c2d5fdbb6b68b3e1bf93dad02f588.tar.gz nextcloud-server-b11ca34bbd0c2d5fdbb6b68b3e1bf93dad02f588.zip |
Merge pull request #40499 from nextcloud/known-mtime-wrapper
add wrapper for external storage to ensure we don't get an mtime that is lower than we know it is
Diffstat (limited to 'apps/files_external')
-rw-r--r-- | apps/files_external/lib/Config/ConfigAdapter.php | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/apps/files_external/lib/Config/ConfigAdapter.php b/apps/files_external/lib/Config/ConfigAdapter.php index 7f7c5e3e2eb..1b83688418c 100644 --- a/apps/files_external/lib/Config/ConfigAdapter.php +++ b/apps/files_external/lib/Config/ConfigAdapter.php @@ -31,6 +31,7 @@ namespace OCA\Files_External\Config; use OC\Files\Storage\FailedStorage; use OC\Files\Storage\Wrapper\Availability; +use OC\Files\Storage\Wrapper\KnownMtime; use OCA\Files_External\Lib\PersonalMount; use OCA\Files_External\Lib\StorageConfig; use OCA\Files_External\Service\UserGlobalStoragesService; @@ -40,29 +41,17 @@ use OCP\Files\Storage; use OCP\Files\Storage\IStorageFactory; use OCP\Files\StorageNotAvailableException; use OCP\IUser; +use Psr\Clock\ClockInterface; /** * Make the old files_external config work with the new public mount config api */ class ConfigAdapter implements IMountProvider { - - /** @var UserStoragesService */ - private $userStoragesService; - - /** @var UserGlobalStoragesService */ - private $userGlobalStoragesService; - - /** - * @param UserStoragesService $userStoragesService - * @param UserGlobalStoragesService $userGlobalStoragesService - */ public function __construct( - UserStoragesService $userStoragesService, - UserGlobalStoragesService $userGlobalStoragesService - ) { - $this->userStoragesService = $userStoragesService; - $this->userGlobalStoragesService = $userGlobalStoragesService; - } + private UserStoragesService $userStoragesService, + private UserGlobalStoragesService $userGlobalStoragesService, + private ClockInterface $clock, + ) {} /** * Process storage ready for mounting @@ -155,7 +144,10 @@ class ConfigAdapter implements IMountProvider { $this->userStoragesService, $storageConfig, $storageConfig->getId(), - $storage, + new KnownMtime([ + 'storage' => $storage, + 'clock' => $this->clock, + ]), '/' . $user->getUID() . '/files' . $storageConfig->getMountPoint(), null, $loader, |