feat: member add logs, improve meta command
This commit is contained in:
parent
f0cb5a9d03
commit
8f39d85486
12 changed files with 73 additions and 15 deletions
|
|
@ -45,11 +45,11 @@ public class MetricsCollectionService(
|
|||
public class BackgroundMetricsCollectionService(ILogger logger, MetricsCollectionService innerService) : BackgroundService
|
||||
{
|
||||
private readonly ILogger _logger = logger.ForContext<BackgroundMetricsCollectionService>();
|
||||
|
||||
|
||||
protected override async Task ExecuteAsync(CancellationToken ct)
|
||||
{
|
||||
_logger.Information("Metrics are disabled, periodically collecting metrics manually");
|
||||
|
||||
|
||||
using var timer = new PeriodicTimer(1.Minutes());
|
||||
while (await timer.WaitForNextTickAsync(ct))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class PluralkitApiService(ILogger logger)
|
|||
}
|
||||
|
||||
return await resp.Content.ReadFromJsonAsync<T>(new JsonSerializerOptions
|
||||
{ PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower }, ct) ??
|
||||
{ PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower }, ct) ??
|
||||
throw new CataloggerError("JSON response from PluralKit API was null");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class WebhookExecutorService(
|
|||
public async Task QueueLogAsync(ulong channelId, IEmbed embed)
|
||||
{
|
||||
if (channelId == 0) return;
|
||||
|
||||
|
||||
var queue = _cache.GetOrAdd(channelId, []);
|
||||
queue.Enqueue(embed);
|
||||
_cache[channelId] = queue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue