Skip to content

Commit

Permalink
feat: Do not stop inactivity tracking service on event dispatch excep…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
angelobreuer committed Dec 1, 2023
1 parent 0690e61 commit 4d848d2
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/Lavalink4NET.InactivityTracking/InactivityTrackingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -628,9 +628,17 @@ await lifetime

await foreach (var eventDispatch in events)
{
await eventDispatch
.InvokeAsync(this, cancellationToken)
.ConfigureAwait(false);
try
{

await eventDispatch
.InvokeAsync(this, cancellationToken)
.ConfigureAwait(false);
}
catch(Exception exception)
{
Logger.EventDispatchFailed(exception);
}
}
}
catch (OperationCanceledException)
Expand Down Expand Up @@ -694,6 +702,9 @@ internal static partial class Logger

[LoggerMessage(12, LogLevel.Debug, "Player '{Label}' was resumed by the inactivity tracking service.", EventName = nameof(PlayerResumedByInactivityTrackingService))]
public static partial void PlayerResumedByInactivityTrackingService(this ILogger<InactivityTrackingService> logger, string label);

[LoggerMessage(13, LogLevel.Warning, "An event dispatch has failed on the inactivity tracking dispatch queue.", EventName = nameof(EventDispatchFailed)]

Check failure on line 706 in src/Lavalink4NET.InactivityTracking/InactivityTrackingService.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

) expected

Check failure on line 706 in src/Lavalink4NET.InactivityTracking/InactivityTrackingService.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

) expected

Check failure on line 706 in src/Lavalink4NET.InactivityTracking/InactivityTrackingService.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

) expected

Check failure on line 706 in src/Lavalink4NET.InactivityTracking/InactivityTrackingService.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

) expected

Check failure on line 706 in src/Lavalink4NET.InactivityTracking/InactivityTrackingService.cs

View workflow job for this annotation

GitHub Actions / build (Release)

) expected
public static partial void EventDispatchFailed(this ILogger<InactivityTrackingService> logger, Exception exception);
}

internal readonly record struct PausedPlayersState(
Expand Down

0 comments on commit 4d848d2

Please sign in to comment.