-
Notifications
You must be signed in to change notification settings - Fork 50
Split listener from ConfiguredClientsStrategy #388
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
Split listener from ConfiguredClientsStrategy #388
Conversation
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.
i think this makes sense, and people should not be using these classes.
i would still do a changelog entry to mention why we do this (avoid instantiating the strategy on every request). the changelog will also help if somebody hacked weird things in the service definition or such and wonders why things stopped working.
\class_alias(Event::class, 'Http\HttplugBundle\Discovery\ConfiguredClientsStrategyEventClass'); | ||
} else { | ||
\class_alias(LegacyEvent::class, 'Http\HttplugBundle\Discovery\ConfiguredClientsStrategyEventClass'); | ||
} |
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 was unused, correct?
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.
Yes, I've removed the ConfiguredClientsStrategyEventClass $e
argument from the onEvent()
method. The event was not used, so I figured the easiest way was to remove this "bc hack".
The listener only executes a static call. This avoids initializing the HttpClient on each request/command call.
7050efb
to
c46491d
Compare
CHANGELOG entry added. |
thanks a lot! |
thanks, tagged 1.19.0 |
Thanks for the merge & quick release! |
Hi ! Just got this error message when moving to 1.19.0 today: Any idea ? |
hi @blackarcanis , do you redefine the services of this bundle somehow? are you sure that the container has been rebuilt for the env in which you encounter the error? if this is with env=prod, can you try |
@dbu Hum yes and only got this issue in our production. Seems to be due to our version of SentryBundle v2.3.0... |
@blackarcanis, I had to manually remove the old cache on production to fix that issue: |
do you deploy to a new directory and build the cache, or simply overwrite the live code and then run |
What's in this PR?
This splits the listener from the
ConfiguredClientsStrategy
.Why?
The listener only executes a static call. This avoids initializing the dependencies (including HttpClient) on each request/command call.
Checklist
Not sure if any of these checks should be done for this PR?