Compare commits

...

2 commits

Author SHA1 Message Date
alyssa
492cce6223 fix: cast hid parameter to char(6) in GetMemberByHid query
Some checks failed
Build and push Docker image / .net docker build (push) Has been cancelled
.net checks / run .net tests (push) Has been cancelled
.net checks / dotnet-format (push) Has been cancelled
avoids casting the hid column, which does a full table scan, which is slow
2026-01-17 16:56:21 -05:00
alyssa
b0e1a7b9ff try shortening http idle timeout for discord client 2026-01-12 01:29:27 -05:00
2 changed files with 5 additions and 2 deletions

View file

@ -35,7 +35,10 @@ public class BaseRestClient: IAsyncDisposable
if (!token.StartsWith("Bot "))
token = "Bot " + token;
Client = new HttpClient();
Client = new HttpClient(new SocketsHttpHandler
{
PooledConnectionIdleTimeout = TimeSpan.FromSeconds(3),
});
Client.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", userAgent);
Client.DefaultRequestHeaders.TryAddWithoutValidation("Authorization", token);

View file

@ -13,7 +13,7 @@ public partial class ModelRepository
public Task<PKMember?> GetMemberByHid(string hid, SystemId? system = null)
{
var query = new Query("members").Where("hid", hid.ToLower());
var query = new Query("members").WhereRaw("hid = (?)::char(6)", hid.ToLower());
if (system != null)
query = query.Where("system", system);
return _db.QueryFirst<PKMember?>(query);