Lspconfig: change server configuration after call to setup

Hi! Quick question. Say I have some lspconfig settings for a language server in my config. I start working on a project then realize I need to change some client settings. What’s the best way to do it?

At the moment, this is my approach, but I think there are cleaner ways using client.notify("workspace/didChangeConfiguration”)

local function updateconfig(name, config)
    local clients = vim.lsp.buf_get_clients(0)
    for _, client in pairs(clients) do
        if client.name == name then
            vim.lsp.stop_client(client.id)
             break
        end
    end
    require"lspconfig"[name].setup(config)
    vim.cmd("LspStart " .. name)
end