Limit getIncomplete query to one row

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
Daniel Kesselberg 2020-12-15 21:42:26 +01:00 committed by backportbot[bot]
parent 98c22e2c77
commit d22ff8624b
1 changed files with 2 additions and 1 deletions

View File

@ -972,7 +972,8 @@ class Cache implements ICache {
->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();