diff options
author | Indrajit Raychaudhuri <irc@indrajit.com> | 2023-09-13 01:02:12 -0500 |
---|---|---|
committer | Indrajit Raychaudhuri <irc@indrajit.com> | 2023-11-30 21:42:23 -0600 |
commit | c3ba4527824c9f4d2e53e7fbd0bff4b84c3012f4 (patch) | |
tree | b09750a0bfad77def691baee1ce8139e04194cdd /src | |
parent | 6b30a92eaff48ae5dd4968e30f3464e04c69d4fd (diff) | |
download | vyos-1x-c3ba4527824c9f4d2e53e7fbd0bff4b84c3012f4.tar.gz vyos-1x-c3ba4527824c9f4d2e53e7fbd0bff4b84c3012f4.zip |
ddclient: T5574: Support per-service cache management for services
Add support for per-service cache management for ddclient providers
via `wait-time` and `expiry-time` options. This allows for finer-grained
control over how often a service is updated and how long the hostname
will be cached before being marked expired in ddclient's cache.
More specifically, `wait-time` controls how often ddclient will attempt
to check for a change in the hostname's IP address, and `expiry-time`
controls how often ddclient to a forced update of the hostname's IP
address.
These options intentionally don't have any default values because they
are provider-specific. They get treated similar to the other provider-
specific options in that they are only used if defined.
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/dns_dynamic.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/conf_mode/dns_dynamic.py b/src/conf_mode/dns_dynamic.py index 8a438cf6f..874c4b689 100755 --- a/src/conf_mode/dns_dynamic.py +++ b/src/conf_mode/dns_dynamic.py @@ -111,6 +111,9 @@ def verify(dyndns): raise ConfigError(f'"{config["protocol"]}" does not support ' f'both IPv4 and IPv6 at the same time for "{config["server"]}"') + if {'wait_time', 'expiry_time'} <= config.keys() and int(config['expiry_time']) < int(config['wait_time']): + raise ConfigError(f'"expiry-time" must be greater than "wait-time"') + return None def generate(dyndns): |