mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-07 06:17:55 +00:00
Remove message query reaction AND open DB connection when obtaining one
This commit is contained in:
parent
a41e20a0a3
commit
ebc311ecc3
7 changed files with 68 additions and 38 deletions
|
|
@ -5,6 +5,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using Dapper;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Newtonsoft.Json;
|
||||
|
|
@ -343,9 +344,11 @@ namespace PluralKit
|
|||
_connectionString = connectionString;
|
||||
}
|
||||
|
||||
public IDbConnection Obtain()
|
||||
public async Task<IDbConnection> Obtain()
|
||||
{
|
||||
return new NpgsqlConnection(_connectionString);
|
||||
var conn = new NpgsqlConnection(_connectionString);
|
||||
await conn.OpenAsync();
|
||||
return conn;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue