Rework caching
This does a *lot* of things. Essentially, it replaces the existing individual proxy- and autoproxy caches on the bot end with a global cache (in Core) that handles all the caching at once, and automatically invalidates the cache once something changes in the datastore. This allows us to do proxying and autoproxying with *zero database queries* (best-case).
This commit is contained in:
@@ -63,9 +63,7 @@ namespace PluralKit.Bot
|
||||
builder.RegisterType<LogChannelService>().AsSelf().SingleInstance();
|
||||
builder.RegisterType<DataFileService>().AsSelf().SingleInstance();
|
||||
builder.RegisterType<WebhookExecutorService>().AsSelf().SingleInstance();
|
||||
builder.RegisterType<ProxyCacheService>().AsSelf().SingleInstance();
|
||||
builder.RegisterType<WebhookCacheService>().AsSelf().SingleInstance();
|
||||
builder.RegisterType<AutoproxyCacheService>().AsSelf().SingleInstance();
|
||||
builder.RegisterType<ShardInfoService>().AsSelf().SingleInstance();
|
||||
builder.RegisterType<CpuStatService>().AsSelf().SingleInstance();
|
||||
builder.RegisterType<PeriodicStatCollector>().AsSelf().SingleInstance();
|
||||
@@ -73,9 +71,6 @@ namespace PluralKit.Bot
|
||||
// Sentry stuff
|
||||
builder.Register(_ => new Scope(null)).AsSelf().InstancePerLifetimeScope();
|
||||
|
||||
// .NET stuff
|
||||
builder.Populate(new ServiceCollection()
|
||||
.AddMemoryCache());
|
||||
|
||||
// Utils
|
||||
builder.Register(c => new HttpClient
|
||||
|
||||
Reference in New Issue
Block a user