Skip to content

Commit

Permalink
Protecting runtime 'datahub_context' (#479)
Browse files Browse the repository at this point in the history
* Protecting runtime datahub_context

* Apply php-cs-fixer changes

Co-authored-by: kingjia90 <kingjia90@users.noreply.github.com>
  • Loading branch information
kingjia90 and kingjia90 committed Mar 1, 2022
1 parent 941d0b0 commit 003ccfd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Controller/WebserviceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -92,7 +93,8 @@ public function webonyxAction(
Service $service,
LocaleServiceInterface $localeService,
Factory $modelFactory,
Request $request
Request $request,
LongRunningHelper $longRunningHelper
) {
$clientname = $request->get('clientname');

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 003ccfd

Please sign in to comment.