From: Remi Gacogne Date: Mon, 25 Aug 2025 13:22:39 +0000 (+0200) Subject: dnsdist: Expose `refreshRuntimeConfiguration` to Lua X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=refs%2Fpull%2F15874%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Expose `refreshRuntimeConfiguration` to Lua Signed-off-by: Remi Gacogne --- diff --git a/pdns/dnsdistdist/dnsdist-lua-bindings.cc b/pdns/dnsdistdist/dnsdist-lua-bindings.cc index 7f019e7528..c8a0efcfc9 100644 --- a/pdns/dnsdistdist/dnsdist-lua-bindings.cc +++ b/pdns/dnsdistdist/dnsdist-lua-bindings.cc @@ -1022,4 +1022,8 @@ void setupLuaBindings(LuaContext& luaCtx, bool client, bool configCheck) }); newThread.detach(); }); + + luaCtx.writeFunction("refreshRuntimeConfiguration", []() { + dnsdist::configuration::refreshLocalRuntimeConfiguration(); + }); } diff --git a/pdns/dnsdistdist/docs/reference/config.rst b/pdns/dnsdistdist/docs/reference/config.rst index 644dfe54a8..329e364c32 100644 --- a/pdns/dnsdistdist/docs/reference/config.rst +++ b/pdns/dnsdistdist/docs/reference/config.rst @@ -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