feat: watchlist repository, remove ef core from all bot code
This commit is contained in:
parent
da4dfae27c
commit
f0511a560c
19 changed files with 155 additions and 97 deletions
|
|
@ -16,6 +16,8 @@
|
|||
using System.Diagnostics;
|
||||
using Catalogger.Backend.Cache.InMemoryCache;
|
||||
using Catalogger.Backend.Database;
|
||||
using Catalogger.Backend.Database.Dapper;
|
||||
using Dapper;
|
||||
using Humanizer;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Prometheus;
|
||||
|
|
@ -39,8 +41,9 @@ public class MetricsCollectionService(
|
|||
|
||||
await using var scope = services.CreateAsyncScope();
|
||||
await using var db = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
|
||||
await using var conn = scope.ServiceProvider.GetRequiredService<DatabaseConnection>();
|
||||
|
||||
var messageCount = await db.Messages.CountAsync(ct);
|
||||
var messageCount = await conn.ExecuteScalarAsync<int>("select count(id) from messages");
|
||||
|
||||
CataloggerMetrics.GuildsCached.Set(guildCache.Size);
|
||||
CataloggerMetrics.ChannelsCached.Set(channelCache.Size);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue