]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
docker: always clear cache in debug mode
authorPetr Špaček <petr.spacek@nic.cz>
Mon, 27 Apr 2020 06:12:10 +0000 (08:12 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Mon, 27 Apr 2020 13:39:38 +0000 (15:39 +0200)
etc/config/config.docker

index 8e58fbd662328dc2bd4c6cbeb2cedcfe10b013ae..7bec09881a6e269135c67e2c9d6b1d3d25edcebf 100644 (file)
@@ -3,6 +3,9 @@
 -- Refer to manual: https://knot-resolver.readthedocs.io/en/stable/
 print('Knot Resolver ' .. package_version())
 
+-- Smaller cache size
+cache.size = 10 * MB
+
 function interactive_mode()
        -- Listen on all interfaces (localhost would not work in Docker)
        net.listen('0.0.0.0', 53, { kind = 'dns' })
@@ -16,9 +19,6 @@ function interactive_mode()
                'http',
        }
 
-       -- Smaller cache size
-       cache.size = 10 * MB
-
        function print_help()
                print('\nUsage\n'
                   .. '=====\n'
@@ -52,6 +52,9 @@ function debug_mode(qname, qtype)
        modules.unload('ta_signal_query')
        modules.unload('ta_update')
 
+       -- always empty cache so this config works reliably outside Docker
+       cache.clear()
+
        -- execute query right after start up and exit when the query is finished
        event.after(0, function()
                -- ultra verbose log