1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 05:06:38 +02:00

Rework the interface for service references.

This commit is contained in:
Sadie Powell
2026-01-10 21:23:23 +00:00
parent 25cd6c96e3
commit bfb47ab5a6
14 changed files with 82 additions and 55 deletions
+5 -2
View File
@@ -134,7 +134,10 @@ class DatabaseRedis final
public:
ServiceReference<Provider> redis;
DatabaseRedis(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, DATABASE | VENDOR), sl(this)
DatabaseRedis(const Anope::string &modname, const Anope::string &creator)
: Module(modname, creator, DATABASE | VENDOR)
, sl(this)
, redis("Redis::Provider")
{
me = this;
@@ -180,7 +183,7 @@ public:
void OnReload(Configuration::Conf &conf) override
{
const auto &block = conf.GetModule(this);
this->redis = ServiceReference<Provider>("Redis::Provider", block.Get<const Anope::string>("engine", "redis/main"));
this->redis.SetServiceName(block.Get<const Anope::string>("engine", "redis/main"));
}
EventReturn OnLoadDatabase() override