Skip to content

Commit

Permalink
Merge pull request #24715 from nextcloud/bug/noid/limit-get-incomplet…
Browse files Browse the repository at this point in the history
…e-to-1

Limit getIncomplete query to one row
  • Loading branch information
rullzer authored Dec 21, 2020
2 parents 97f2de0 + e0e76bb commit 4973f9b
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 @@ -997,7 +997,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 4973f9b

Please sign in to comment.