Fix database connection pool contention (maybe)
Instead of acquiring a connection per service per request, we acquire connections more often but at a more granular level, meaning they're also disposed of more quickly instead of staying for a long time in case of long-running commands or leaks.
This commit is contained in:
@@ -152,14 +152,12 @@ namespace PluralKit.Bot
|
||||
/// Subclass of ICommandContext with PK-specific additional fields and functionality
|
||||
public class PKCommandContext : SocketCommandContext
|
||||
{
|
||||
public IDbConnection Connection { get; }
|
||||
public PKSystem SenderSystem { get; }
|
||||
|
||||
private object _entity;
|
||||
|
||||
public PKCommandContext(DiscordSocketClient client, SocketUserMessage msg, IDbConnection connection, PKSystem system) : base(client, msg)
|
||||
public PKCommandContext(DiscordSocketClient client, SocketUserMessage msg, PKSystem system) : base(client, msg)
|
||||
{
|
||||
Connection = connection;
|
||||
SenderSystem = system;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user