From 003ccfd7eaad15ad03970f5eb604066242d0653c Mon Sep 17 00:00:00 2001 From: JiaJia Ji Date: Tue, 1 Mar 2022 15:13:45 +0100 Subject: [PATCH] Protecting runtime 'datahub_context' (#479) * Protecting runtime datahub_context * Apply php-cs-fixer changes Co-authored-by: kingjia90 --- src/Controller/WebserviceController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Controller/WebserviceController.php b/src/Controller/WebserviceController.php index 14309ceb..73de81dc 100644 --- a/src/Controller/WebserviceController.php +++ b/src/Controller/WebserviceController.php @@ -32,6 +32,7 @@ use Pimcore\Bundle\DataHubBundle\Service\OutputCacheService; use Pimcore\Cache\Runtime; use Pimcore\Controller\FrontendController; +use Pimcore\Helper\LongRunningHelper; use Pimcore\Localization\LocaleServiceInterface; use Pimcore\Logger; use Pimcore\Model\Factory; @@ -92,7 +93,8 @@ public function webonyxAction( Service $service, LocaleServiceInterface $localeService, Factory $modelFactory, - Request $request + Request $request, + LongRunningHelper $longRunningHelper ) { $clientname = $request->get('clientname'); @@ -121,6 +123,8 @@ public function webonyxAction( if (isset($config['graphql']) && isset($config['graphql']['not_allowed_policy'])) { PimcoreDataHubBundle::setNotAllowedPolicy($config['graphql']['not_allowed_policy']); } + + $longRunningHelper->addPimcoreRuntimeCacheProtectedItems(['datahub_context']); Runtime::set('datahub_context', $context); ClassTypeDefinitions::build($service, $context);