Prevent error with orphaned shares when updating user mount cache

This commit is contained in:
Vincent Petry 2016-08-25 18:06:13 +02:00 committed by Lukas Reschke
parent fe3e7629e2
commit c4f303d19c
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
2 changed files with 8 additions and 2 deletions

View File

@ -246,6 +246,11 @@ class SharedMount extends MountPoint implements MoveableMount {
->from('filecache')
->where($builder->expr()->eq('fileid', $builder->createNamedParameter($this->getStorageRootId())));
return $query->execute()->fetchColumn();
$result = $query->execute();
$row = $result->fetch();
if ($row) {
return $row['storage'];
}
return -1;
}
}

View File

@ -159,7 +159,8 @@ class UserMountCache implements IUserMountCache {
'mount_id' => $mount->getMountId()
], ['root_id', 'user_id']);
} 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());
}
}