Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions lib/private/Comments/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace OC\Comments;

use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Cache\CappedMemoryCache;
use OCP\Comments\CommentsEvent;
use OCP\Comments\Events\BeforeCommentUpdatedEvent;
use OCP\Comments\Events\CommentAddedEvent;
Expand All @@ -33,8 +34,7 @@
use Psr\Log\LoggerInterface;

class Manager implements ICommentsManager {
/** @var IComment[] */
protected array $commentsCache = [];
protected CappedMemoryCache $commentsCache;

/** @var \Closure[] */
protected array $eventHandlerClosures = [];
Expand All @@ -55,6 +55,7 @@ public function __construct(
protected IRootFolder $rootFolder,
protected IEventDispatcher $eventDispatcher,
) {
$this->commentsCache = new CappedMemoryCache(256);
}

/**
Expand Down Expand Up @@ -1322,7 +1323,7 @@ public function deleteReferencesOfActor($actorType, $actorId): bool {
->setParameter('id', $actorId);

$affectedRows = $qb->executeStatement();
$this->commentsCache = [];
$this->commentsCache->clear();
return true;
}

Expand All @@ -1342,7 +1343,7 @@ public function deleteCommentsAtObject($objectType, $objectId): bool {
->setParameter('id', $objectId);

$affectedRows = $qb->executeStatement();
$this->commentsCache = [];
$this->commentsCache->clear();
return true;
}

Expand Down Expand Up @@ -1601,7 +1602,7 @@ public function deleteCommentsExpiredAtObject(string $objectType, string $object

$affectedRows = $qb->executeStatement();

$this->commentsCache = [];
$this->commentsCache->clear();

return $affectedRows > 0;
}
Expand Down
Loading