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
parent 27fdc6575d
commit e0e76bb784
No known key found for this signature in database
GPG key ID: 36E3664E099D0614

View file

@ -997,7 +997,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();