]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
unbound-dhcp-leases-bridge: Read configuration only once
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 29 Mar 2022 11:28:49 +0000 (11:28 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 29 Mar 2022 11:28:49 +0000 (11:28 +0000)
This saves some resources when we re-read the same configuration file
too often.

Suggested-by: Anthony Heading <ajrh@ajrh.net>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/unbound/unbound-dhcp-leases-bridge

index c0e5977bffb7fc4f939e76f9b05d6a8b993d5714..b098d98b4292c0dae032ce4dbe2c5cb7b1786d3d 100644 (file)
@@ -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 = {}