mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat(bot): add Redis cache
This commit is contained in:
parent
fadf007abc
commit
c2094e3b7a
9 changed files with 560 additions and 1 deletions
|
|
@ -44,7 +44,13 @@ public class BotModule: Module
|
|||
}).AsSelf().SingleInstance();
|
||||
builder.RegisterType<Cluster>().AsSelf().SingleInstance();
|
||||
builder.RegisterType<RedisGatewayService>().AsSelf().SingleInstance();
|
||||
builder.Register(c => { return new MemoryDiscordCache(); }).AsSelf().As<IDiscordCache>().SingleInstance();
|
||||
builder.Register<IDiscordCache>(c => {
|
||||
var botConfig = c.Resolve<BotConfig>();
|
||||
|
||||
if (botConfig.UseRedisCache)
|
||||
return new RedisDiscordCache(c.Resolve<ILogger>());
|
||||
return new MemoryDiscordCache();
|
||||
}).AsSelf().SingleInstance();
|
||||
builder.RegisterType<PrivateChannelService>().AsSelf().SingleInstance();
|
||||
|
||||
builder.Register(c =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue