about summary refs log tree commit diff
path: root/ModerationClient/Services
diff options
context:
space:
mode:
Diffstat (limited to 'ModerationClient/Services')
-rw-r--r--ModerationClient/Services/ClientContainer.cs18
1 files changed, 5 insertions, 13 deletions
diff --git a/ModerationClient/Services/ClientContainer.cs b/ModerationClient/Services/ClientContainer.cs

index 957e3cc..ebdbab6 100644 --- a/ModerationClient/Services/ClientContainer.cs +++ b/ModerationClient/Services/ClientContainer.cs
@@ -5,18 +5,10 @@ using Microsoft.Extensions.Logging; namespace ModerationClient.Services; -public class ClientContainer { - private readonly ILogger<ClientContainer> _logger; - private readonly MatrixAuthenticationService _authService; - private readonly CommandLineConfiguration _cfg; +public class ClientContainer(ILogger<ClientContainer> logger, MatrixAuthenticationService authService, CommandLineConfiguration cfg) { + private readonly CommandLineConfiguration _cfg = cfg; - public ClientContainer(ILogger<ClientContainer> logger, MatrixAuthenticationService authService, CommandLineConfiguration cfg) { - _logger = logger; - _authService = authService; - _cfg = cfg; - } - - private bool _isRunning = false; + private bool _isRunning; public void EnsureRunning() { @@ -25,7 +17,7 @@ public class ClientContainer { _ = Task.Run(Run).ContinueWith(t => { if (t.IsFaulted) { - _logger.LogError(t.Exception, "Error in client container task"); + logger.LogError(t.Exception, "Error in client container task"); } return _isRunning = false; }); @@ -34,7 +26,7 @@ public class ClientContainer { private async Task Run() { Console.WriteLine("Running client view model loop..."); - ArgumentNullException.ThrowIfNull(_authService.Homeserver, nameof(_authService.Homeserver)); + ArgumentNullException.ThrowIfNull(authService.Homeserver, nameof(authService.Homeserver)); } } \ No newline at end of file