mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
fix: clear in-memory cached mounts for user when adding/removing mounts
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
42c6ffa7a9
commit
41825529e7
1 changed files with 7 additions and 0 deletions
|
|
@ -524,6 +524,12 @@ class UserMountCache implements IUserMountCache {
|
|||
$query->delete('mounts')
|
||||
->where($query->expr()->eq('mount_point', $query->createNamedParameter($mountPoint)));
|
||||
$query->executeStatement();
|
||||
|
||||
$parts = explode('/', $mountPoint);
|
||||
if (count($parts) > 3) {
|
||||
[, $userId] = $parts;
|
||||
unset($this->mountsForUsers[$userId]);
|
||||
}
|
||||
}
|
||||
|
||||
public function addMount(IUser $user, string $mountPoint, ICacheEntry $rootCacheEntry, string $mountProvider, ?int $mountId = null): void {
|
||||
|
|
@ -536,6 +542,7 @@ class UserMountCache implements IUserMountCache {
|
|||
'mount_id' => $mountId,
|
||||
'mount_provider_class' => $mountProvider
|
||||
]);
|
||||
unset($this->mountsForUsers[$user->getUID()]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue