fix: improve recovery and auto-start flows

This commit is contained in:
2026-04-25 00:06:25 +08:00
parent 39db8c012f
commit 9701c88c8b
5 changed files with 207 additions and 14 deletions
@@ -93,7 +93,14 @@ public sealed class LiveRoomPollingBackgroundService : BackgroundService
try
{
using var notificationScope = _serviceScopeFactory.CreateScope();
var logService = notificationScope.ServiceProvider.GetRequiredService<ISystemLogService>();
var emailNotificationService = notificationScope.ServiceProvider.GetRequiredService<IEmailNotificationService>();
await logService.WriteAsync(
SystemLogLevel.Error,
"Scheduler",
"Background live room polling failed.",
ex.ToString(),
cancellationToken: CancellationToken.None);
if (ShouldSendExceptionEmail(BuildExceptionEmailKey("background-loop", ex)))
{
await emailNotificationService.SendExceptionAsync(