-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger][Redis] Adding support for lazy connect #38563
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
Conversation
@Nyholm Thank you for the quick reply + patch! - MESSENGER_NOTIFICATIONS_TRANSPORT_DSN=redis://redis:6379/messages
+ MESSENGER_NOTIFICATIONS_TRANSPORT_DSN=redis://redis:6379/messages?lazy=1 Working like a charm! |
src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php
Outdated
Show resolved
Hide resolved
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.
(with one comment to fix before merging)
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.
👍
This PR was merged into the 4.4 branch. Discussion ---------- [Cache] Make Redis initializers static | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes .. or maybe? | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | I am on very thin ice now. I saw a comment on similar code here: #38563 (comment) These anonymous functions in the cache component could also be made static to avoid being connected to the object using the Redis trait. Feel free to correct me if this does not make much sense. Commits ------- ad8de57 [Cache] Make Redis initializers static
378557a
to
1d7c801
Compare
Thank you @Nyholm. |
Thank you for the reviews, tests and merge. |
With inspiration from the CacheComponent. This PR makes it possible to make the connection to Redis only when you first use it.