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,