Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-09-22 16:07:51 +0300
committerJoas Schilling <coding@schilljs.com>2020-09-22 16:07:51 +0300
commit287e54f43347c6bc92bf9fbf8dea3a6a4a174d1c (patch)
tree0285f3f2778b64b17f49c7b909df7747e87730ab /lib
parentbc1ffd82d7557642d6f50352d1191b1b0aae436f (diff)
Set a limit on the query
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/MatterbridgeManager.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/MatterbridgeManager.php b/lib/MatterbridgeManager.php
index 7d1dda0a2..c560e1c0c 100644
--- a/lib/MatterbridgeManager.php
+++ b/lib/MatterbridgeManager.php
@@ -760,14 +760,14 @@ class MatterbridgeManager {
->from('talk_bridges', 'b')
->where(
$qb->expr()->eq('room_id', $qb->createNamedParameter($roomId, IQueryBuilder::PARAM_INT))
- );
- $req = $qb->execute();
+ )
+ ->setMaxResults(1);
+ $result = $qb->execute();
$jsonValues = '{"enabled":false,"pid":0,"parts":[]}';
- while ($row = $req->fetch()) {
+ if ($row = $result->fetch()) {
$jsonValues = $row['json_values'];
- break;
}
- $req->closeCursor();
+ $result->closeCursor();
return json_decode($jsonValues, true);
}