]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Expose `refreshRuntimeConfiguration` to Lua 15874/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 25 Aug 2025 13:22:39 +0000 (15:22 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 25 Aug 2025 13:22:39 +0000 (15:22 +0200)
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
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 644dfe54a80285ca9cf04ae02dfb03e505aa161e..329e364c3255bab075dd93fec52b716b3983572f 100644 (file)
@@ -2330,6 +2330,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