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:
@@ -8,12 +8,10 @@ namespace PluralKit.Bot.Commands
|
||||
public class MemberProxy
|
||||
{
|
||||
private IDataStore _data;
|
||||
private ProxyCacheService _proxyCache;
|
||||
|
||||
public MemberProxy(IDataStore data, ProxyCacheService proxyCache)
|
||||
public MemberProxy(IDataStore data)
|
||||
{
|
||||
_data = data;
|
||||
_proxyCache = proxyCache;
|
||||
}
|
||||
|
||||
public async Task Proxy(Context ctx, PKMember target)
|
||||
@@ -117,9 +115,6 @@ namespace PluralKit.Bot.Commands
|
||||
await _data.SaveMember(target);
|
||||
await ctx.Reply($"{Emojis.Success} Member proxy tags set to `{requestedTag.ProxyString.SanitizeMentions()}`.");
|
||||
}
|
||||
|
||||
await _proxyCache.InvalidateResultsForSystem(ctx.System);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user