bug fixes (#703)

* catch expected shutdown error in scheduler service

* fix streaming mode inconsistencies
This commit is contained in:
Jason Dove
2022-03-13 18:45:21 -05:00
committed by GitHub
parent 5731edc82e
commit 7de1a87bbf
6 changed files with 68 additions and 8 deletions
+6 -2
View File
@@ -56,7 +56,7 @@ public class SchedulerService : BackgroundService
{
await Task.Delay(TimeSpan.FromMinutes(toWait), cancellationToken);
}
catch (TaskCanceledException)
catch (Exception ex) when (ex is TaskCanceledException or OperationCanceledException)
{
// do nothing
}
@@ -89,10 +89,14 @@ public class SchedulerService : BackgroundService
await ScanPlexMediaSources(cancellationToken);
await MatchTraktLists(cancellationToken);
}
catch (Exception ex) when (ex is TaskCanceledException or OperationCanceledException)
{
// do nothing
}
catch (Exception ex)
{
_logger.LogWarning(ex, "Error during scheduler run");
try
{
using (IServiceScope scope = _serviceScopeFactory.CreateScope())