Merge pull request #51921 from nextcloud/usermountcache-logging

feat: add debug logging for adding/removing items from the user mounts cache
This commit is contained in:
Ferdinand Thiessen 2025-04-04 00:21:14 +02:00 committed by GitHub
commit 0c51b09005
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -98,15 +98,18 @@ class UserMountCache implements IUserMountCache {
$userUID = $user->getUID();
try {
foreach ($addedMounts as $mount) {
$this->logger->debug("Adding mount '{$mount->getKey()}' for user '$userUID'", ['app' => 'files', 'mount_provider' => $mount->getMountProvider()]);
$this->addToCache($mount);
/** @psalm-suppress InvalidArgument */
$this->mountsForUsers[$userUID][$mount->getKey()] = $mount;
}
foreach ($removedMounts as $mount) {
$this->logger->debug("Removing mount '{$mount->getKey()}' for user '$userUID'", ['app' => 'files', 'mount_provider' => $mount->getMountProvider()]);
$this->removeFromCache($mount);
unset($this->mountsForUsers[$userUID][$mount->getKey()]);
}
foreach ($changedMounts as $mount) {
$this->logger->debug("Updating mount '{$mount->getKey()}' for user '$userUID'", ['app' => 'files', 'mount_provider' => $mount->getMountProvider()]);
$this->updateCachedMount($mount);
/** @psalm-suppress InvalidArgument */
$this->mountsForUsers[$userUID][$mount->getKey()] = $mount;