diff --git a/src/Service/OutputCacheService.php b/src/Service/OutputCacheService.php index cda51920..13ddf223 100644 --- a/src/Service/OutputCacheService.php +++ b/src/Service/OutputCacheService.php @@ -87,7 +87,7 @@ public function save(Request $request, JsonResponse $response, $extraTags = []): $extraTags = array_merge(['output', 'datahub', $clientname], $extraTags); $event = new OutputCachePreSaveEvent($request, $response); - $this->eventDispatcher->dispatch(OutputCacheEvents::PRE_SAVE, $event); + $this->eventDispatcher->dispatch($event, OutputCacheEvents::PRE_SAVE); $this->saveToCache($cacheKey, $event->getResponse(), $extraTags); } @@ -134,7 +134,7 @@ private function useCache(Request $request): bool // So far, cache will be used, unless the listener denies it $event = new OutputCachePreLoadEvent($request, true); - $this->eventDispatcher->dispatch(OutputCacheEvents::PRE_LOAD, $event); + $this->eventDispatcher->dispatch($event, OutputCacheEvents::PRE_LOAD); return $event->isUseCache(); }