Skip to content
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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrerenard
Copy link

@andrerenard andrerenard commented May 13, 2022

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.

@lgtm-com
Copy link

lgtm-com bot commented May 13, 2022

This pull request introduces 1 alert when merging 156f784 into 195e359 - view on LGTM.com

new alerts:

  • 1 for Syntax error

@andrerenard andrerenard force-pushed the ar/enable_dns_cache branch from 156f784 to b6add7c Compare May 13, 2022 19:14
@andrerenard andrerenard requested review from jrs65 and ketiltrout June 15, 2022 17:39
Copy link
Member

@ketiltrout ketiltrout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks okay

Copy link
Contributor

@jrs65 jrs65 left a 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"])
Copy link
Contributor

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,
Copy link
Contributor

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.

@jrs65
Copy link
Contributor

jrs65 commented Sep 8, 2022

@andrerenard I think this one can get finished off now #242 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants