diff --git a/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php b/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php index f31234019a7..4174f83c73d 100644 --- a/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php +++ b/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php @@ -18,8 +18,8 @@ use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdsToPublishOrDiscard; use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdToPublishOrDiscard; use Neos\ContentRepository\Core\Feature\WorkspaceCreation\Exception\WorkspaceAlreadyExists; +use Neos\ContentRepositoryRegistry\Factory\ProjectionCatchUpTrigger\CatchUpTriggerWithSynchronousOption; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindAncestorNodesFilter; -use Neos\ContentRepository\Core\Projection\ContentGraph\NodeTypeConstraints; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\Flow\I18n\Exception\IndexOutOfBoundsException; use Neos\Flow\I18n\Exception\InvalidFormatPlaceholderException; @@ -538,8 +538,11 @@ public function publishNodeAction(string $nodeAddress, WorkspaceName $selectedWo ) ), ); - $contentRepository->handle($command) - ->block(); + // performance speedup + CatchUpTriggerWithSynchronousOption::synchronously(fn() => + $contentRepository->handle($command) + ->block() + ); $this->addFlashMessage($this->translator->translateById( 'workspaces.selectedChangeHasBeenPublished', @@ -576,8 +579,11 @@ public function discardNodeAction(string $nodeAddress, WorkspaceName $selectedWo ) ), ); - $contentRepository->handle($command) - ->block(); + // performance speedup + CatchUpTriggerWithSynchronousOption::synchronously(fn() => + $contentRepository->handle($command) + ->block() + ); $this->addFlashMessage($this->translator->translateById( 'workspaces.selectedChangeHasBeenDiscarded', @@ -630,8 +636,11 @@ public function publishOrDiscardNodesAction(array $nodes, string $action, string $selectedWorkspace, NodeIdsToPublishOrDiscard::create(...$nodesToPublishOrDiscard), ); - $contentRepository->handle($command) - ->block(); + // performance speedup + CatchUpTriggerWithSynchronousOption::synchronously(fn() => + $contentRepository->handle($command) + ->block() + ); $this->addFlashMessage($this->translator->translateById( 'workspaces.selectedChangesHaveBeenPublished', [], @@ -646,8 +655,11 @@ public function publishOrDiscardNodesAction(array $nodes, string $action, string $selectedWorkspace, NodeIdsToPublishOrDiscard::create(...$nodesToPublishOrDiscard), ); - $contentRepository->handle($command) - ->block(); + // performance speedup + CatchUpTriggerWithSynchronousOption::synchronously(fn() => + $contentRepository->handle($command) + ->block() + ); $this->addFlashMessage($this->translator->translateById( 'workspaces.selectedChangesHaveBeenDiscarded', [], @@ -672,11 +684,12 @@ public function publishWorkspaceAction(WorkspaceName $workspace): void $contentRepositoryId = SiteDetectionResult::fromRequest($this->request->getHttpRequest()) ->contentRepositoryId; $contentRepository = $this->contentRepositoryRegistry->get($contentRepositoryId); - $contentRepository->handle( - new PublishWorkspace( + // performance speedup + CatchUpTriggerWithSynchronousOption::synchronously(fn() => + $contentRepository->handle(new PublishWorkspace( $workspace - ) - )->block(); + ))->block() + ); $workspace = $contentRepository->getWorkspaceFinder()->findOneByName($workspace); /** @var Workspace $workspace Otherwise the command handler would have thrown an exception */ /** @var WorkspaceName $baseWorkspaceName Otherwise the command handler would have thrown an exception */ @@ -705,11 +718,14 @@ public function discardWorkspaceAction(WorkspaceName $workspace): void $contentRepositoryId = SiteDetectionResult::fromRequest($this->request->getHttpRequest()) ->contentRepositoryId; $contentRepository = $this->contentRepositoryRegistry->get($contentRepositoryId); - $contentRepository->handle( - DiscardWorkspace::create( - $workspace, - ) - )->block(); + // performance speedup + CatchUpTriggerWithSynchronousOption::synchronously(fn() => + $contentRepository->handle( + DiscardWorkspace::create( + $workspace, + ) + )->block() + ); $this->addFlashMessage($this->translator->translateById( 'workspaces.allChangesInWorkspaceHaveBeenDiscarded',