From 7cc62297aea57a69406a0822ae1ba3e14e5d2899 Mon Sep 17 00:00:00 2001 From: Charles-Henri Bruyand Date: Thu, 2 Jun 2022 16:59:51 +0200 Subject: [PATCH] try to appease the spell checker AND the code format checker :) --- .github/actions/spell-check/expect.txt | 1 + pdns/dnsdist-lua.cc | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index 914d0b2512..73d7e40a86 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -303,6 +303,7 @@ csync ctime ctor ctx +custommetrics cve cvename cvs diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index 9ccec6a624..d1ec7dca2f 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -2879,13 +2879,15 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) g_stats.entries.emplace_back(name, &g_stats.customCounters[name]); addMetricDefinition(name, "counter", description); } - } else if (type == "gauge") { + } + else if (type == "gauge") { auto itp = g_stats.customGauges.emplace(name, 0.); if (itp.second) { g_stats.entries.emplace_back(name, &g_stats.customGauges[name]); addMetricDefinition(name, "gauge", description); } - } else { + } + else { g_outputBuffer = "declareMetric unknown type '" + type + "'\n"; errlog("Unable to declareMetric '%s': no such type '%s'", name, type); return false; @@ -2924,7 +2926,8 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) auto counter = g_stats.customCounters.find(name); if (counter != g_stats.customCounters.end()) { return (double)counter->second.load(); - } else { + } + else { auto gauge = g_stats.customGauges.find(name); if (gauge != g_stats.customGauges.end()) { return gauge->second.load(); -- 2.47.2