Skip to content

Commit

Permalink
add debug logging for usermountcache updates
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed May 2, 2023
1 parent 436a088 commit 1ae6e04
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions lib/private/Files/Config/UserMountCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,16 @@ private function findChangedMounts(array $newMounts, array $cachedMounts) {
}

private function addToCache(ICachedMountInfo $mount) {
$msg = "adding mount info at " . $mount->getMountPoint() . " to " . json_encode([
'storage_id' => $mount->getStorageId(),
'root_id' => $mount->getRootId(),
'user_id' => $mount->getUser()->getUID(),
'mount_point' => $mount->getMountPoint(),
'mount_id' => $mount->getMountId(),
'mount_provider_class' => $mount->getMountProvider(),
]);
$this->logger->warning($msg, ['exception' => new \Exception($msg)]);

if ($mount->getStorageId() !== -1) {
$this->connection->insertIfNotExist('*PREFIX*mounts', [
'storage_id' => $mount->getStorageId(),
Expand All @@ -198,6 +208,16 @@ private function addToCache(ICachedMountInfo $mount) {
}

private function updateCachedMount(ICachedMountInfo $mount) {
$msg = "updating mount info at " . $mount->getMountPoint() . " to " . json_encode([
'storage_id' => $mount->getStorageId(),
'root_id' => $mount->getRootId(),
'user_id' => $mount->getUser()->getUID(),
'mount_point' => $mount->getMountPoint(),
'mount_id' => $mount->getMountId(),
'mount_provider_class' => $mount->getMountProvider(),
]);
$this->logger->warning($msg, ['exception' => new \Exception($msg)]);

$builder = $this->connection->getQueryBuilder();

$query = $builder->update('mounts')
Expand All @@ -212,6 +232,8 @@ private function updateCachedMount(ICachedMountInfo $mount) {
}

private function removeFromCache(ICachedMountInfo $mount) {
$this->logger->warning("removing mount info from " . $mount->getMountPoint(), ['exception' => new \Exception("removing mount info")]);

$builder = $this->connection->getQueryBuilder();

$query = $builder->delete('mounts')
Expand Down

0 comments on commit 1ae6e04

Please sign in to comment.