-
-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Register the idle connection listener #1739
Register the idle connection listener #1739
Conversation
d1bd383
to
88471c3
Compare
88471c3
to
536a096
Compare
28a4fe1
to
846ba31
Compare
eaacc08
to
cfda672
Compare
1f57511
to
a9fb4dc
Compare
c883146
to
5192741
Compare
5192741
to
8e0bbc6
Compare
8b3a078
to
36a7031
Compare
5117c16
to
b4122a1
Compare
a8f1faf
to
87ac9a4
Compare
7ffcd85
to
bb1034e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks!
Maybe squash + sync the commit title and PR title?
For the psalm failure, something like this might do it in psalm.xml.dist:
<UndefinedClass>
<errorLevel type="suppress">
<!-- [...] -->
<referencedClass name=" use Symfony\Bridge\Doctrine\Middleware\IdleConnection\Listener"/>
</errorLevel>
</UndefinedClass>
a3c1c3f
to
ccf7ac5
Compare
ccf7ac5
to
6bca630
Compare
6bca630
to
166c5f8
Compare
* @param ArrayObject<string, int> $connectionExpiries | ||
* @param array<string, int> $ttlByConnection | ||
*/ | ||
public function __construct(ArrayObject $connectionExpiries, array $ttlByConnection) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public function __construct(ArrayObject $connectionExpiries, array $ttlByConnection) | |
public function __construct(ArrayObject $expiringConnections, array $ttlByConnection) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm not mistaken, this is a list of expiries and not connections. There were discussions regarding the naming of variables above, and it was decided to use connectionExpiries
linked to symfony/symfony#53214
This pull request introduces a solution based on the RoadRunner bundle's Doctrine ORM/ODM middleware https://github.com/Baldinof/roadrunner-bundle/blob/3.x/src/Integration/Doctrine/DoctrineORMMiddleware.php.
It checks the status of Doctrine connection, then if the connection is initialized and connected, it performs a 'ping' to check its viability. If the ping fails, it closes the connection.