From 151b81780a9859e87e89a9372dcf4fba97830348 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Thu, 12 Dec 2024 11:36:39 +0100 Subject: [PATCH 1/5] fix(deps): update System.Text.Json transitive dependency to fix security vulenrability --- src/Atc.Hosting/Atc.Hosting.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Atc.Hosting/Atc.Hosting.csproj b/src/Atc.Hosting/Atc.Hosting.csproj index 49ea401..3955c49 100644 --- a/src/Atc.Hosting/Atc.Hosting.csproj +++ b/src/Atc.Hosting/Atc.Hosting.csproj @@ -14,8 +14,8 @@ - + From 84740f07b916e4d42deb3a09c1a9704d500aba15 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Thu, 12 Dec 2024 11:36:59 +0100 Subject: [PATCH 2/5] style: simplifying new expression in NullBackgroundServiceHealthService --- src/Atc.Hosting/Internal/NullBackgroundServiceHealthService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Atc.Hosting/Internal/NullBackgroundServiceHealthService.cs b/src/Atc.Hosting/Internal/NullBackgroundServiceHealthService.cs index 32dd2fb..5a54071 100644 --- a/src/Atc.Hosting/Internal/NullBackgroundServiceHealthService.cs +++ b/src/Atc.Hosting/Internal/NullBackgroundServiceHealthService.cs @@ -5,7 +5,7 @@ internal sealed class NullBackgroundServiceHealthService : IBackgroundServiceHea /// /// Returns static instance of /// - public static NullBackgroundServiceHealthService Instance => new NullBackgroundServiceHealthService(); + public static NullBackgroundServiceHealthService Instance => new(); private NullBackgroundServiceHealthService() { From 95c2a8b76d280e8d339ba484160a6e38cc74502c Mon Sep 17 00:00:00 2001 From: Per Kops Date: Thu, 12 Dec 2024 11:37:13 +0100 Subject: [PATCH 3/5] chore(deps): updating nuget packages --- src/Atc.Hosting/Atc.Hosting.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Atc.Hosting/Atc.Hosting.csproj b/src/Atc.Hosting/Atc.Hosting.csproj index 3955c49..c51f64d 100644 --- a/src/Atc.Hosting/Atc.Hosting.csproj +++ b/src/Atc.Hosting/Atc.Hosting.csproj @@ -14,10 +14,10 @@ - + - + \ No newline at end of file From c2d71883a1e03c67a2d0a5da491635404114fd72 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Thu, 12 Dec 2024 11:44:04 +0100 Subject: [PATCH 4/5] test: simplifying if statement in MyWorkerService --- .../XUnitTestTypes/MyWorkerService.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/test/Atc.Hosting.Tests/XUnitTestTypes/MyWorkerService.cs b/test/Atc.Hosting.Tests/XUnitTestTypes/MyWorkerService.cs index 658e951..ce62214 100644 --- a/test/Atc.Hosting.Tests/XUnitTestTypes/MyWorkerService.cs +++ b/test/Atc.Hosting.Tests/XUnitTestTypes/MyWorkerService.cs @@ -31,14 +31,9 @@ public MyWorkerService( protected override Task OnExceptionAsync( Exception exception, CancellationToken stoppingToken) - { - if (exception is MyWorkerException) - { - throw exception; - } - - return Task.CompletedTask; - } + => exception is MyWorkerException + ? throw exception + : Task.CompletedTask; public override Task DoWorkAsync( CancellationToken stoppingToken) From 23e22e4de94eba4e7648ae7af7f86ad1b6f6a0de Mon Sep 17 00:00:00 2001 From: Per Kops Date: Thu, 12 Dec 2024 11:44:45 +0100 Subject: [PATCH 5/5] chore(sample): add logging statements to service Start/Stop methods --- sample/Atc.Hosting.TimeFile.Sample/TimeFileScheduleWorker.cs | 2 ++ sample/Atc.Hosting.TimeFile.Sample/TimeFileWorker.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sample/Atc.Hosting.TimeFile.Sample/TimeFileScheduleWorker.cs b/sample/Atc.Hosting.TimeFile.Sample/TimeFileScheduleWorker.cs index f0f9ee6..f4c3223 100644 --- a/sample/Atc.Hosting.TimeFile.Sample/TimeFileScheduleWorker.cs +++ b/sample/Atc.Hosting.TimeFile.Sample/TimeFileScheduleWorker.cs @@ -23,12 +23,14 @@ public TimeFileScheduleWorker( public override Task StartAsync( CancellationToken cancellationToken) { + logger.LogInformation("Started"); return base.StartAsync(cancellationToken); } public override Task StopAsync( CancellationToken cancellationToken) { + logger.LogInformation("Stopped"); return base.StopAsync(cancellationToken); } diff --git a/sample/Atc.Hosting.TimeFile.Sample/TimeFileWorker.cs b/sample/Atc.Hosting.TimeFile.Sample/TimeFileWorker.cs index 64f5984..f7370b6 100644 --- a/sample/Atc.Hosting.TimeFile.Sample/TimeFileWorker.cs +++ b/sample/Atc.Hosting.TimeFile.Sample/TimeFileWorker.cs @@ -23,12 +23,14 @@ public TimeFileWorker( public override Task StartAsync( CancellationToken cancellationToken) { + logger.LogInformation("Started"); return base.StartAsync(cancellationToken); } public override Task StopAsync( CancellationToken cancellationToken) { + logger.LogInformation("Stopped"); return base.StopAsync(cancellationToken); }