mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-07 07:36:01 +02:00
feat: Enhance diagnostic logging for service resolution during startup
This commit is contained in:
@@ -202,8 +202,28 @@ while (true)
|
|||||||
}
|
}
|
||||||
}, heartbeatCts.Token);
|
}, heartbeatCts.Token);
|
||||||
|
|
||||||
// ── Enumerate hosted services (DI resolution) ────────────────────
|
// ── Resolve singletons one-by-one to find which one hangs ────────
|
||||||
Console.Error.WriteLine("[DIAG] Resolving IHostedService instances from DI...");
|
Console.Error.WriteLine("[DIAG] Resolving PresenceTracker...");
|
||||||
|
_ = app.Services.GetRequiredService<PresenceTracker>();
|
||||||
|
Console.Error.WriteLine("[DIAG] PresenceTracker OK.");
|
||||||
|
|
||||||
|
Console.Error.WriteLine("[DIAG] Resolving JwtTokenService...");
|
||||||
|
_ = app.Services.GetRequiredService<JwtTokenService>();
|
||||||
|
Console.Error.WriteLine("[DIAG] JwtTokenService OK.");
|
||||||
|
|
||||||
|
Console.Error.WriteLine("[DIAG] Resolving FileStorageService...");
|
||||||
|
_ = app.Services.GetRequiredService<FileStorageService>();
|
||||||
|
Console.Error.WriteLine("[DIAG] FileStorageService OK.");
|
||||||
|
|
||||||
|
Console.Error.WriteLine("[DIAG] Resolving IChatBroadcaster...");
|
||||||
|
_ = app.Services.GetServices<IChatBroadcaster>().ToList();
|
||||||
|
Console.Error.WriteLine("[DIAG] IChatBroadcaster OK.");
|
||||||
|
|
||||||
|
Console.Error.WriteLine("[DIAG] Resolving IChatService...");
|
||||||
|
_ = app.Services.GetRequiredService<IChatService>();
|
||||||
|
Console.Error.WriteLine("[DIAG] IChatService OK.");
|
||||||
|
|
||||||
|
Console.Error.WriteLine("[DIAG] Resolving IHostedService instances...");
|
||||||
var hostedServices = app.Services.GetServices<IHostedService>().ToList();
|
var hostedServices = app.Services.GetServices<IHostedService>().ToList();
|
||||||
Console.Error.WriteLine($"[DIAG] Found {hostedServices.Count} hosted services:");
|
Console.Error.WriteLine($"[DIAG] Found {hostedServices.Count} hosted services:");
|
||||||
foreach (var svc in hostedServices)
|
foreach (var svc in hostedServices)
|
||||||
|
|||||||
Reference in New Issue
Block a user