]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
prefill: remove zone file from disk on failure
authorPetr Špaček <petr.spacek@nic.cz>
Mon, 30 Dec 2019 13:06:37 +0000 (14:06 +0100)
committerLukáš Ježek <lukas.jezek@nic.cz>
Tue, 7 Jan 2020 10:02:31 +0000 (11:02 +0100)
Empty zone file was causing errors after restart and user had to wait to
retry interval before re-download. Let's not polute filesystem with
incomplete files.

modules/prefill/prefill.lua

index 32079f51941c2c6c80b6c961d1fe79c73436dcf1..d7be3439715e57085ee9352c5ece4f96a39236e1 100644 (file)
@@ -111,6 +111,7 @@ function forward_references.fill_cache()
                                .. "will retry root zone download in %s",
                                errmsg, display_delay(rz_cur_interval))
                        restart_timer(rz_cur_interval)
+                       os.remove(rz_local_fname)
                        return
                end
                file_ttl = rz_default_interval