Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.

Commit

Permalink
bug #251 Reset wasExceptionThrown (dnna)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.2-dev branch.

Discussion
----------

Reset wasExceptionThrown

Fixes php-pm/php-pm-httpkernel#62

The problem is that when an exception is thrown in a PPM worker, the variable wasExceptionThrown stays true in all subsequent requests therefore email sending stops.

Commits
-------

5365755 Reset wasExceptionThrown
  • Loading branch information
fabpot committed Aug 29, 2018
2 parents f1ba055 + 5365755 commit 3b9687f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions EventListener/EmailSenderListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,9 @@ public static function getSubscribedEvents()

return $listeners;
}

public function reset()
{
$this->wasExceptionThrown = false;
}
}
1 change: 1 addition & 0 deletions Resources/config/swiftmailer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@

<service id="swiftmailer.email_sender.listener" class="Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener">
<tag name="kernel.event_subscriber" />
<tag name="kernel.reset" method="reset" />
<argument type="service" id="service_container" />
<argument type="service" id="logger" on-invalid="null" />
</service>
Expand Down

0 comments on commit 3b9687f

Please sign in to comment.