]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
modules/prefill: Fetch root zone file asynchronously
authorLukáš Ježek <lukas.jezek@nic.cz>
Fri, 22 Nov 2019 14:33:04 +0000 (15:33 +0100)
committerPetr Špaček <petr.spacek@nic.cz>
Fri, 20 Dec 2019 09:15:52 +0000 (10:15 +0100)
modules/prefill/prefill.lua

index 50169baabc0f2097b2285399445451dd86e92f17..7df181dba0f1a0233f5a14952ce9a0934a409241 100644 (file)
@@ -101,7 +101,7 @@ local function import(fname)
        end
 end
 
-local function timer()
+local function fill_cache()
        local file_ttl = get_file_ttl(rz_local_fname)
 
        if file_ttl > rz_interval_threshold then
@@ -138,6 +138,10 @@ local function timer()
        event.reschedule(rz_event_id, rz_cur_interval * sec)
 end
 
+local function timer()
+       worker.bg_worker.cq:wrap(fill_cache)
+end
+
 function prefill.init()
        math.randomseed(os.time())
 end