Skip to content

Commit 993a82e

Browse files
authored
Move setting DNS created and ttl into its own function (#692)
1 parent b60f307 commit 993a82e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

zeroconf/_dns.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,12 @@ def is_recent(self, now: float) -> bool:
197197
def reset_ttl(self, other: 'DNSRecord') -> None:
198198
"""Sets this record's TTL and created time to that of
199199
another record."""
200-
self.created = other.created
201-
self.ttl = other.ttl
200+
self._set_created_ttl(other.created, other.ttl)
201+
202+
def _set_created_ttl(self, created: float, ttl: Union[float, int]) -> None:
203+
"""Set the created and ttl of a record."""
204+
self.created = created
205+
self.ttl = ttl
202206
self._expiration_time = None
203207
self._stale_time = None
204208
self._recent_time = None

0 commit comments

Comments
 (0)