]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
datamodel: policy-loader: avoid dependency on lua-cqueues docs-develop-poli-9evpby/deployments/6145
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 3 Feb 2025 15:33:04 +0000 (16:33 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 3 Feb 2025 15:35:16 +0000 (16:35 +0100)
daemon/lua/kres-gen-33.lua
daemon/lua/kres-gen.sh
python/knot_resolver/datamodel/templates/policy-config.lua.j2

index 9bf16b7f460a40dfd10d6d2e7683b31a648f0874..f37cc7c6a461bc94ba56993080ab22686d45ace1 100644 (file)
@@ -11,6 +11,8 @@ struct timeval {
        __suseconds_t tv_usec;
 };
 
+unsigned sleep(unsigned seconds);
+
 typedef struct knot_dump_style knot_dump_style_t;
 extern const knot_dump_style_t KR_DUMP_STYLE_DEFAULT;
 struct kr_cdb_api {};
index 910c5b75bb420477fe64cbf8c90534e35f1ee9ca..eeb101d856d3953b9e01ba1fbd4989db2ad25faf 100755 (executable)
@@ -62,6 +62,10 @@ struct timeval {
        __suseconds_t tv_usec;
 };
 "
+# We use this in policy-loader
+printf "
+unsigned sleep(unsigned seconds);
+"
 
 ## Various types (mainly), from libknot and libkres
 
index 3fbb7cc113734acec8bc7e9a856159225f3de4e5..fbd824b38ec7012de19cc67b02566f0f57c13f86 100644 (file)
@@ -46,7 +46,7 @@ cache.open({{ cfg.cache.size_max.bytes() }}, 'lmdb://{{ cfg.cache.storage }}')
 -- termination of the policy-loader before it is
 -- added into starting_processes in sd_notify.py.
 -- If this happens, the READY notification will end with an error.
-worker.sleep(1)
+C.sleep(1)
 
 -- exit policy-loader properly
 quit()