Skip to content

Commit fb529bc

Browse files
committed
Handle duplicate removes
1 parent 73e3d18 commit fb529bc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

zeroconf/_handlers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ def async_updates_from_response(self, msg: DNSIncoming) -> None:
331331
updates: List[RecordUpdate] = []
332332
address_adds: List[DNSAddress] = []
333333
other_adds: List[DNSRecord] = []
334-
removes: List[DNSRecord] = []
334+
removes: Set[DNSRecord] = set()
335335
now = msg.now
336336
unique_types: Set[Tuple[str, int, int]] = set()
337337

@@ -355,7 +355,7 @@ def async_updates_from_response(self, msg: DNSIncoming) -> None:
355355
# expired and exists in the cache
356356
elif maybe_entry is not None:
357357
updates.append(RecordUpdate(record, maybe_entry))
358-
removes.append(record)
358+
removes.add(record)
359359

360360
if unique_types:
361361
self._async_mark_unique_cached_records_older_than_1s_to_expire(unique_types, msg.answers, now)

0 commit comments

Comments
 (0)