dns/ddclient: move accounting of "last accessed timestamp' to poller, when execute() fails for whatever reason without an update, we want to prevent it looping to fast.

This commit is contained in:
Ad Schellevis 2023-05-09 21:12:16 +02:00
parent c5d27b9ab3
commit 6340b8a1e2
2 changed files with 4 additions and 2 deletions

View file

@ -128,6 +128,5 @@ class BaseAccount:
# if current address doesn't equal the current state, propagate the fact
return True
else:
# unmodified, keep track of last access timestamp
self._last_accessed = time.time()
# unmodified, poller keeps track of last access timestamp
return False

View file

@ -151,6 +151,9 @@ class Poller:
if self.is_verbose:
syslog.syslog(syslog.LOG_NOTICE, "Account %s changed" % acc.description)
needs_flush = True
else:
# update last accessed timestamp
acc.update_state(None)
except Exception as e:
# fatal exception, update atime so we're not going to retry too soon
acc.update_state(None)