Symfony4 and Event Dispatcher issue, the script continues 25 seconds after the event

58 views Asked by At

i have a issue with Event Dispatcher on Symfony4. The script contnues 25 seconds after the event finished . Here the code:

controller (necessary part):

$this->logger->notice("Log Start");
$response = new JsonResponse($responseArray, 200);
$this->eventDispatcher->dispatch(new FilterUserResponseEvent($user, $request, $response), FOSUserEvents::REGISTRATION_COMPLETED);
$this->logger->notice("Log End");

EventSubscriber (necessary part):

$this->logger->notice("REGISTRATION_COMPLETED Start");
...
$this->logger->notice("REGISTRATION_COMPLETED End");

The results of the logs is:

10:00:00 Log Start
10:00:00 REGISTRATION_COMPLETED Start
10:00:00 REGISTRATION_COMPLETED End
10:00:25 Log End

how is this possible? in my script there is nothing between the end of the event and the other log. maybe it is a symfony core bug? I want to say that it is not systematic, it happens sometimes.

thanks for your help!

0

There are 0 answers