Merge pull request #1200 from nextcloud/stable9.1-usermountcache-orphanedshare
[stable10] Prevent error with orphaned shares when updating user mount cache
This commit is contained in:
commit
782c3138c9
|
@ -246,6 +246,12 @@ class SharedMount extends MountPoint implements MoveableMount {
|
||||||
->from('filecache')
|
->from('filecache')
|
||||||
->where($builder->expr()->eq('fileid', $builder->createNamedParameter($this->getStorageRootId())));
|
->where($builder->expr()->eq('fileid', $builder->createNamedParameter($this->getStorageRootId())));
|
||||||
|
|
||||||
return $query->execute()->fetchColumn();
|
$result = $query->execute();
|
||||||
|
$row = $result->fetch();
|
||||||
|
$result->closeCursor();
|
||||||
|
if ($row) {
|
||||||
|
return $row['storage'];
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,7 +159,8 @@ class UserMountCache implements IUserMountCache {
|
||||||
'mount_id' => $mount->getMountId()
|
'mount_id' => $mount->getMountId()
|
||||||
], ['root_id', 'user_id']);
|
], ['root_id', 'user_id']);
|
||||||
} else {
|
} else {
|
||||||
$this->logger->error('Error getting storage info for mount at ' . $mount->getMountPoint());
|
// in some cases this is legitimate, like orphaned shares
|
||||||
|
$this->logger->debug('Could not get storage info for mount at ' . $mount->getMountPoint());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue