diff --git a/Iceshrimp.Backend/Core/Extensions/WebApplicationExtensions.cs b/Iceshrimp.Backend/Core/Extensions/WebApplicationExtensions.cs index 85004fde..38cb0b03 100644 --- a/Iceshrimp.Backend/Core/Extensions/WebApplicationExtensions.cs +++ b/Iceshrimp.Backend/Core/Extensions/WebApplicationExtensions.cs @@ -86,6 +86,14 @@ public static class WebApplicationExtensions Environment.Exit(1); } + if (args.Contains("--recompute-counters")) + { + app.Logger.LogInformation("Recomputing note & user counters, this will take a while..."); + var maintenanceSvc = provider.GetRequiredService(); + await maintenanceSvc.RecomputeNoteCountersAsync(); + await maintenanceSvc.RecomputeUserCountersAsync(); + } + app.Logger.LogInformation("Verifying redis connection..."); var cache = provider.GetService(); if (cache == null)