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

github.com/nextcloud/notifications.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-08-16 14:14:17 +0300
committerCarl Schwan <carl@carlschwan.eu>2022-08-16 14:14:17 +0300
commit151209f2b8b87360f728f8eff39e025aa5a46eae (patch)
treeaefa74dd890a11d06cb9780b332696f691b1b35f /lib
parent871e50e46dbae402b881c354ec06459c787f8331 (diff)
Handle empty list of notifications to delete
Save two query Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'lib')
-rw-r--r--lib/Handler.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Handler.php b/lib/Handler.php
index 4d16908..4601d0f 100644
--- a/lib/Handler.php
+++ b/lib/Handler.php
@@ -108,6 +108,10 @@ class Handler {
}
$statement->closeCursor();
+ if (count($notifications) === 0) {
+ return [];
+ }
+
$this->connection->beginTransaction();
try {
$shouldFlush = $this->manager->defer();