Skip to content

Commit 6340b8a

Browse files
committed
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.
1 parent c5d27b9 commit 6340b8a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

dns/ddclient/src/opnsense/scripts/ddclient/lib/account/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,5 @@ def execute(self):
128128
# if current address doesn't equal the current state, propagate the fact
129129
return True
130130
else:
131-
# unmodified, keep track of last access timestamp
132-
self._last_accessed = time.time()
131+
# unmodified, poller keeps track of last access timestamp
133132
return False

dns/ddclient/src/opnsense/scripts/ddclient/lib/poller.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ def run(self):
151151
if self.is_verbose:
152152
syslog.syslog(syslog.LOG_NOTICE, "Account %s changed" % acc.description)
153153
needs_flush = True
154+
else:
155+
# update last accessed timestamp
156+
acc.update_state(None)
154157
except Exception as e:
155158
# fatal exception, update atime so we're not going to retry too soon
156159
acc.update_state(None)

0 commit comments

Comments
 (0)