Skip to content

Commit

Permalink
Merge pull request #939 from nextcloud/fix/groupfolders-duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelklehr authored Aug 8, 2023
2 parents c4e3a8c + d789fb6 commit 1a6c98f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Service/StorageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct(IDBConnection $db, Logger $logger, SystemConfig $sys
*/
public function getMounts(): \Generator {
$qb = $this->db->getQueryBuilder();
$qb->select('root_id', 'storage_id', 'mount_provider_class')
$qb->selectDistinct(['root_id', 'storage_id', 'mount_provider_class']) // to avoid scanning each occurrence of a groupfolder
->from('mounts')
->where($qb->expr()->in('mount_provider_class', $qb->createPositionalParameter(self::ALLOWED_MOUNT_TYPES, IQueryBuilder::PARAM_STR_ARRAY)));
$result = $qb->executeQuery();
Expand Down

0 comments on commit 1a6c98f

Please sign in to comment.