From 091cb62ada59e4eae22d371c224e3b5cfaf60a0d Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 30 Mar 2022 09:56:33 +0000 Subject: [PATCH] unbound-dhcp-leases-bridge: Read configuration only once This saves some resources when we re-read the same configuration file too often. Suggested-by: Anthony Heading Signed-off-by: Michael Tremer --- config/unbound/unbound-dhcp-leases-bridge | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/unbound/unbound-dhcp-leases-bridge b/config/unbound/unbound-dhcp-leases-bridge index c0e5977bff..b098d98b42 100644 --- a/config/unbound/unbound-dhcp-leases-bridge +++ b/config/unbound/unbound-dhcp-leases-bridge @@ -22,6 +22,7 @@ import argparse import datetime import daemon +import functools import ipaddress import logging import logging.handlers @@ -444,6 +445,7 @@ class Lease(object): return "localdomain" @staticmethod + @functools.cache def read_settings(filename): settings = {} -- 2.39.5