From: Michael Tremer Date: Thu, 6 Apr 2023 14:04:47 +0000 (+0200) Subject: unbound-dhcp-leases-bridge: Only wait if all events have been processed X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7d612f032831c4b09862cf7e700cbfe402ee5a22;p=people%2Fms%2Fipfire-2.x.git unbound-dhcp-leases-bridge: Only wait if all events have been processed This seems to solve a race condition where some hostnames where not properly passed to unbound - probably if there were too many DHCP updates in too short time. Signed-off-by: Michael Tremer --- diff --git a/config/unbound/unbound-dhcp-leases-bridge b/config/unbound/unbound-dhcp-leases-bridge index 3f4f10a900..1c927474ae 100644 --- a/config/unbound/unbound-dhcp-leases-bridge +++ b/config/unbound/unbound-dhcp-leases-bridge @@ -116,6 +116,9 @@ class UnboundDHCPLeasesBridge(object): for event in i.event_gen(): # Nothing to do if event is None: + # Wait a moment before we start the next iteration + time.sleep(5) + break # Decode the event @@ -143,9 +146,6 @@ class UnboundDHCPLeasesBridge(object): # Reset update_hosts = update_leases = False - # Wait a moment before we start the next iteration - time.sleep(5) - log.info("Unbound DHCP Leases Bridge terminated") def update_dhcp_leases(self):