mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +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
|
|
@ -2,6 +2,7 @@ using Autofac;
|
|||
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
using Myriad.Cache;
|
||||
using Myriad.Gateway;
|
||||
using Myriad.Types;
|
||||
using Myriad.Rest;
|
||||
|
|
@ -51,6 +52,10 @@ public class Init
|
|||
if (config.UseRedisRatelimiter)
|
||||
await redis.InitAsync(coreConfig);
|
||||
|
||||
var cache = services.Resolve<IDiscordCache>();
|
||||
if (cache is RedisDiscordCache)
|
||||
await (cache as RedisDiscordCache).InitAsync(coreConfig.RedisAddr, config.ClientId!.Value);
|
||||
|
||||
if (config.Cluster == null)
|
||||
{
|
||||
// "Connect to the database" (ie. set off database migrations and ensure state)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue