From 7660ca52bf1a82591dd6becde9697885f561e67f Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Mon, 26 Aug 2024 03:18:07 -0400 Subject: [PATCH] write_recap: Remove unnecessary recap existence check --- ddclient.in | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/ddclient.in b/ddclient.in index 71e63fe..8c39e98 100755 --- a/ddclient.in +++ b/ddclient.in @@ -1567,19 +1567,7 @@ sub write_recap { # represent `undef` in the cache file and to simplify testing. Also, entries for non-recap # variables (which can happen after changing a host's protocol or after switching to a # different version of ddclient) are deleted. - # - # TODO: The "configuration change detection" variables are also syncronized if `$recap{$h}` - # doesn't exist. Why is this done? Perhaps the intention was to prevent the - # force-if-config-changed logic from triggering the very first cycle (when there is no - # previous update attempt). However: - # * There's a bug: This function isn't called until after `update_nics` has already - # checked the force-if-config-changed condition, so syncing the values here is too late - # to suppress the first cycle's force-if-config-changed logic. - # * It's unnecessary: If there have not been any update attempts, an update attempt - # should be made anyway, and already is. (`update_nics` already forces an update if - # `$recap{$h}` doesn't exist, and that check is done before the force-if-config-changed - # check.) - if (!exists $recap{$h} || $config{$h}{'update'}) { + if ($config{$h}{'update'}) { delete($config{$h}{'update'}); $recap{$h} = {}; for my $v (keys(%$vars)) {