[backend/startup] Add --recompute-counters argument
This commit is contained in:
parent
27b3be774e
commit
9cd99eb244
1 changed files with 8 additions and 0 deletions
|
@ -86,6 +86,14 @@ public static class WebApplicationExtensions
|
||||||
Environment.Exit(1);
|
Environment.Exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (args.Contains("--recompute-counters"))
|
||||||
|
{
|
||||||
|
app.Logger.LogInformation("Recomputing note & user counters, this will take a while...");
|
||||||
|
var maintenanceSvc = provider.GetRequiredService<DatabaseMaintenanceService>();
|
||||||
|
await maintenanceSvc.RecomputeNoteCountersAsync();
|
||||||
|
await maintenanceSvc.RecomputeUserCountersAsync();
|
||||||
|
}
|
||||||
|
|
||||||
app.Logger.LogInformation("Verifying redis connection...");
|
app.Logger.LogInformation("Verifying redis connection...");
|
||||||
var cache = provider.GetService<IDistributedCache>();
|
var cache = provider.GetService<IDistributedCache>();
|
||||||
if (cache == null)
|
if (cache == null)
|
||||||
|
|
Loading…
Add table
Reference in a new issue