Skip to content

Commit

Permalink
fix(db): also chunk MariaDB deletes
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Larch <[email protected]>
  • Loading branch information
miaulalala committed Sep 11, 2023
1 parent 5218bdc commit e6fd4ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

namespace OCA\Activity;

use Doctrine\DBAL\Platforms\MariaDBPlatform;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use OCA\Activity\Filter\AllFilter;
use OCP\Activity\IEvent;
Expand Down Expand Up @@ -386,7 +387,8 @@ public function deleteActivities($conditions) {

// Add galera safe delete chunking if using mysql
// Stops us hitting wsrep_max_ws_rows when large row counts are deleted
if ($this->connection->getDatabasePlatform() instanceof MySQLPlatform) {
$platform = $this->connection->getDatabasePlatform();
if ($platform instanceof MySQLPlatform || $platform instanceof MariaDBPlatform) {

Check failure on line 391 in lib/Data.php

View workflow job for this annotation

GitHub Actions / Nextcloud

UndefinedClass

lib/Data.php:391:66: UndefinedClass: Class, interface or enum named Doctrine\DBAL\Platforms\MariaDBPlatform does not exist (see https://psalm.dev/019)
// Then use chunked delete
$max = 100000;
$delete->setMaxResults($max);
Expand Down

0 comments on commit e6fd4ce

Please sign in to comment.