Skip to content

Commit

Permalink
Fix Duplicates in Groupfolders: Only scan each groupfolder once
Browse files Browse the repository at this point in the history
fixes #916

Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr committed Aug 5, 2023
1 parent a33803b commit d789fb6
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 d789fb6

Please sign in to comment.