mirror of
https://github.com/nextcloud/server.git
synced 2026-02-19 02:38:40 -05: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
d2f21352c6
commit
4b00db977f
1 changed files with 7 additions and 0 deletions
|
|
@ -536,6 +536,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 {
|
||||
|
|
@ -553,6 +559,7 @@ class UserMountCache implements IUserMountCache {
|
|||
|
||||
try {
|
||||
$query->executeStatement();
|
||||
unset($this->mountsForUsers[$user->getUID()]);
|
||||
} catch (DbalException $e) {
|
||||
if ($e->getReason() !== DbalException::REASON_UNIQUE_CONSTRAINT_VIOLATION) {
|
||||
throw $e;
|
||||
|
|
|
|||
Loading…
Reference in a new issue