From e883f2a42bbebb4fc71adb33d6f925a4120e4d98 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 22 Jul 2019 20:27:30 -0700 Subject: [PATCH] ircd::m::keys: Add additional fetch to interface. --- include/ircd/m/keys.h | 1 + modules/m_keys.cc | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/ircd/m/keys.h b/include/ircd/m/keys.h index ceb4c6617..9783207dd 100644 --- a/include/ircd/m/keys.h +++ b/include/ircd/m/keys.h @@ -64,6 +64,7 @@ struct ircd::m::keys static void get(const string_view &server_name, const closure &); static void get(const string_view &server_name, const string_view &key_id, const closure &); static void query(const string_view &query_server, const queries &, const closure_bool &); + static size_t fetch(const queries &); using super_type::tuple; using super_type::operator=; diff --git a/modules/m_keys.cc b/modules/m_keys.cc index 063c02043..d8e4b4302 100644 --- a/modules/m_keys.cc +++ b/modules/m_keys.cc @@ -300,6 +300,20 @@ ircd::m::keys_get_timeout { "default", 20000L } }; +size_t +IRCD_MODULE_EXPORT +ircd::m::keys::fetch(const queries &queries) +{ + size_t ret(0); + get(queries, [&ret](const auto &) + { + ++ret; + return true; + }); + + return ret; +} + void IRCD_MODULE_EXPORT ircd::m::keys::get(const string_view &server_name,