Skip to content
Open
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
35 changes: 35 additions & 0 deletions Classes/Aop/FlushContentCacheAfterIndexingAspect.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace Flowpack\ElasticSearch\ContentRepositoryQueueIndexer\Aop;

use Neos\ContentRepository\Domain\Model\Node;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Aop\JoinPointInterface;
use Neos\Neos\Fusion\Cache\ContentCacheFlusher;

/**
* @Flow\Aspect
*/
class FlushContentCacheAfterIndexingAspect
{
/**
* @Flow\Inject
* @var ContentCacheFlusher
*/
protected $contentCacheFlusher;

/**
* @param JoinPointInterface $joinPoint
* @return void
*
* @Flow\AfterReturning("method(Flowpack\ElasticSearch\ContentRepositoryAdaptor\Driver\Version6\IndexerDriver->document())")
*/
public function afterDocumentIndexing(JoinPointInterface $joinPoint): void
{
$node = $joinPoint->getMethodArgument('node');
if (!$node instanceof Node) {
return;
}
$this->contentCacheFlusher->registerNodeChange($node);
}
}