-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
apache2-mod-proxy: better handling regexp extraction #9609
apache2-mod-proxy: better handling regexp extraction #9609
Conversation
@@ -246,7 +246,7 @@ class BalancerMember(object): | |||
""" | |||
|
|||
def __init__(self, management_url, balancer_url, module): | |||
self.host = regexp_extraction(management_url, str(EXPRESSION), 4) | |||
self.host = regexp_extraction(management_url, EXPRESSION, 4) | |||
self.management_url = str(management_url) | |||
self.protocol = regexp_extraction(management_url, EXPRESSION, 3) | |||
self.port = regexp_extraction(management_url, EXPRESSION, 5) |
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 function is seaching for the same regex in the same string four times, every time using a different group of the result. That looks very inefficient to me... I guess this could be improved at some point :)
Backport to stable-10: 💚 backport PR created✅ Backport PR branch: Backported as #9616 🤖 @patchback |
* apache2-mod-proxy: better handling regexp extraction * add changelog frag (cherry picked from commit bf5c7f8)
@russoz thanks! |
…dling regexp extraction (#9616) apache2-mod-proxy: better handling regexp extraction (#9609) * apache2-mod-proxy: better handling regexp extraction * add changelog frag (cherry picked from commit bf5c7f8) Co-authored-by: Alexei Znamensky <[email protected]>
SUMMARY
Improve the handling of the data extraction using regexp by pre-compiling the regular expressions.
ISSUE TYPE
COMPONENT NAME
apache2_mod_proxy