-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(request_forwarder): Add config option to set DNS cache TTL #243
base: master
Are you sure you want to change the base?
Conversation
This pull request introduces 1 alert when merging 156f784 into 195e359 - view on LGTM.com new alerts:
|
156f784
to
b6add7c
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.
This looks okay
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.
A few optional suggestions.
@@ -85,10 +85,17 @@ def __init__(self, conf, reset=False, check_config=False): | |||
raise ConfigError( | |||
f"Failed parsing value 'timeout' ({self.config['timeout']})." | |||
) from e | |||
try: | |||
dns_cache_ttl = str2total_seconds(self.config["dns_cache_ttl"]) |
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 one should probably have a default value rather than throwing a ConfigError if it's missing.
@@ -18,6 +18,7 @@ | |||
"host": "localhost", | |||
"port": 12055, | |||
"log_level": "DEBUG", | |||
"dns_cache_ttl": 60, |
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.
You might use a string like 60s
or 1m
to exercise the parsing logic.
@andrerenard I think this one can get finished off now #242 is merged. |
Blocked because of issues running unit tests, will convert to full PR once #242 is merged and I can verify the tests pass.
This change will also require a change to the coco config in ch_ansible.