]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Expose `refreshRuntimeConfiguration` to Lua 16053/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 25 Aug 2025 13:22:39 +0000 (15:22 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 28 Aug 2025 09:25:29 +0000 (11:25 +0200)
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit 6ac7c5514aa28d63e0d46e06c4c37df4213585d4)

pdns/dnsdistdist/dnsdist-lua-bindings.cc
pdns/dnsdistdist/docs/reference/config.rst

index 7f019e7528725af86f4bb28c6bb749e669118d92..c8a0efcfc93dd6845c1cfaad3a4412d8e474034a 100644 (file)
@@ -1022,4 +1022,8 @@ void setupLuaBindings(LuaContext& luaCtx, bool client, bool configCheck)
     });
     newThread.detach();
   });
+
+  luaCtx.writeFunction("refreshRuntimeConfiguration", []() {
+    dnsdist::configuration::refreshLocalRuntimeConfiguration();
+  });
 }
index c5eb392382521a4084e560acb42f899e43e524aa..875f5fc38c8b5a3c6ca501e763a1c6c60b53d528 100644 (file)
@@ -2305,6 +2305,12 @@ Other functions
   Code is supplied as a string, not as a function object.
   Note that this function does nothing in 'client' or 'config-check' modes.
 
+.. function:: refreshRuntimeConfiguration()
+
+  .. versionadded:: 2.0.1
+
+  This function is only useful when executed from a separate Lua thread created by :func:`newThread`, to ensure that the runtime-modifiable configuration is up-to-date.
+
 .. function:: setTicketsKeyAddedHook(callback)
 
   .. versionadded:: 1.9.6