Skip to content

Commit

Permalink
Merge pull request #24791 from nextcloud/backport/24715/stable20
Browse files Browse the repository at this point in the history
[stable20] Limit getIncomplete query to one row
  • Loading branch information
rullzer authored Dec 21, 2020
2 parents 98c22e2 + d22ff86 commit 2a91d78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/private/Files/Cache/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,8 @@ public function getIncomplete() {
->from('filecache')
->whereStorageId()
->andWhere($query->expr()->lt('size', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT)))
->orderBy('fileid', 'DESC');
->orderBy('fileid', 'DESC')
->setMaxResults(1);

$result = $query->execute();
$path = $result->fetchColumn();
Expand Down

0 comments on commit 2a91d78

Please sign in to comment.